Zip a two lists : zip « Buildin Function « Python






Zip a two lists

Zip a two lists

L1 = [1,2,3,4]
L2 = [5,6,7,8]

print zip(L1,L2)

           
       








Related examples in the same category

1.Generator ExpressionsGenerator Expressions
2.Loop over two or more sequences at the same timeLoop over two or more sequences at the same time
3.Read element in a zipped listRead element in a zipped list
4.Zip three tuplesZip three tuples
5.Difference between zip and mapDifference between zip and map
6.Zip function demo: returns a list of tuplesZip function demo:  returns a list of tuples