Logo

Programming-Idioms

History of Idiom 163 > diff from v4 to v5

Edit summary for version 5 by Oldboy:
New Python implementation by user [Oldboy]

Version 4

2017-08-21, 19:30:42

Version 5

2017-10-28, 14:00:36

Idiom #163 Print list elements by group of 2

Print all the list elements, two by two, assuming list length is even.

Idiom #163 Print list elements by group of 2

Print all the list elements, two by two, assuming list length is even.

Code
for x in zip(list_[::2], list_[1::2]):
    print(x)
Comments bubble
original list is called list_