Flatten a list in python

前端 未结 7 1243
逝去的感伤
逝去的感伤 2020-12-06 19:14

I have a list like this:

[[(video1,4)], [(video2,5),(video3,8)], [(video1,5)], [(video5, 7), (video6,9)]...]

each item in this list may con

7条回答
  •  囚心锁ツ
    2020-12-06 20:11

    Here's another one (no libraries):

    def plus(a,b): return a + b
    reduce(plus, your_list)
    

提交回复
热议问题