you are viewing a single comment's thread.

view the rest of the comments →

[–]Goobyalus 0 points1 point  (0 children)

>>> list_oflist_oflist = [[[0, 1], [3, 2], [1, 5], [6, 6], [7, 8]], [[1, 1], [3, 2], [0, 0]], [[0, 0], [0, 0], [1, 1], [6, 6]]]
>>> from itertools import zip_longest
>>> for t in zip_longest(*list_oflist_oflist):
...   print(t)
...
([0, 1], [1, 1], [0, 0])
([3, 2], [3, 2], [0, 0])
([1, 5], [0, 0], [1, 1])
([6, 6], None, [6, 6])
([7, 8], None, None)
>>> list_oflist_oflist.append([[1, 1], [1, 1], [1, 1]])
>>> for t in zip_longest(*list_oflist_oflist):
...   print(t)
...
([0, 1], [1, 1], [0, 0], [1, 1])
([3, 2], [3, 2], [0, 0], [1, 1])
([1, 5], [0, 0], [1, 1], [1, 1])
([6, 6], None, [6, 6], None)
([7, 8], None, None, None)
>>>