Python zip Iterator

zip(p,q,...) iterator combines p[0] with q[0], p[1] with q[1] and so on.

>>> from itertools import *
>>> for i in zip('1234','AB'):
>>> print (i)
('1', 'A')
('2', 'B')
>>> from itertools import *
>>> from itertools import *
>>> for i in zip('1234','AB', 'xyz'):
>>> print (i)
('1', 'A', 'x')
('2', 'B', 'y')


















endmemo.com © 2024  | Terms of Use | Privacy | Home