Make delicious recipes!

zip(*iterables)



zip is a function which accepts variable number of arguments and creates tuples such that:
- first tuple contains first element of all arguments.
- second tuple contains second element of all arguments.
and so on.


Example:


>>> x = [1,2,3]
>>> y = ['a', 'b', 'c']


>>> zip (x,y)
<zip object at 0x027B8030>


>>> list (zip (x,y))
[(1, 'a'), (2, 'b'), (3, 'c')]


>>> list (zip (x,y,x,y))
[(1, 'a', 1, 'a'), (2, 'b', 2, 'b'), (3, 'c', 3, 'c')]











Like us on Facebook to remain in touch
with the latest in technology and tutorials!


Got a thought to share or found a
bug in the code?
We'd love to hear from you:

Name:
Email: (Your email is not shared with anybody)
Comment:

Facebook comments:

Site Owner: Sachin Goyal