python list comprehensions; compressing a list of lists?

后端 未结 13 1984
名媛妹妹
名媛妹妹 2020-11-30 01:49

guys. I\'m trying to find the most elegant solution to a problem and wondered if python has anything built-in for what I\'m trying to do.

What I\'m doing is this. I

13条回答
  •  盖世英雄少女心
    2020-11-30 02:20

    You can use pyxtension:

    from pyxtension.streams import stream
    stream([ [1,2,3], [4,5], [], [6] ]).flatMap() == range(7)
    

提交回复
热议问题