list of lists use for zip python code example
Example 1: python zip a list of lists
list(zip(*[[list], [of], [lists]]))
list_of_lists = [[1,2], [3,4], [5,6]]
list(zip(*list_of_lists))
--> [(1, 3, 5), (2, 4, 6)]
list_of_lists = [[1,2], ['a',4], [5,6,7]]
list(zip(*list_of_lists))
--> [(1, 'a', 5), (2, 4, 6)]
Example 2: zip listas python
>>> meses = ["marzo", "abril", "mayo"]
>>> estados = ["ventoso", "lluvioso", "florido y hermoso"]
>>> for mes, estado in zip(meses, estados):
... print(mes, estado)
...
marzo ventoso
abril lluvioso
mayo florido y hermoso