Flatten a list in python

前端 未结 7 1253
逝去的感伤
逝去的感伤 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)
    
    0 讨论(0)
提交回复
热议问题