Anonymous user
Loop over multiple arrays simultaneously: Difference between revisions
Loop over multiple arrays simultaneously (view source)
Revision as of 21:13, 29 November 2009
, 14 years ago→zip_longest
m (Fixed lang tags.) |
|||
Line 414:
===zip_longest===
Python 3.X has zip_longest which fills shorter iterables with its fillvalue argument which defaults to None
<lang python>>>> from itertools import zip_longest
>>> print ( '\n'.join(''.join(x) for x in zip_longest('abc', 'ABCD', '12345', fillvalue='#')) )
aA1
|