Difference between zip and map : zip « Buildin Function « Python






Difference between zip and map

Difference between zip and map
S1 = 'abc'
S2 = 'xyz123'

print zip(S1, S2)


print  map(None, S1, S2)


           
       








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.Zip a two listsZip a two lists
4.Read element in a zipped listRead element in a zipped list
5.Zip three tuplesZip three tuples
6.Zip function demo: returns a list of tuplesZip function demo:  returns a list of tuples