Logo

Programming-Idioms

History of Idiom 143 > diff from v12 to v13

Edit summary for version 13 by Xris:
New Python implementation by user [Xris]

Version 12

2018-03-24, 17:31:54

Version 13

2018-03-27, 11:45:39

Idiom #143 Iterate alternatively over two lists

Iterate alternatively over the elements of the list items1 and items2. For each iteration, print the element.

Explain what happens if items1 and items2 have different size.

Idiom #143 Iterate alternatively over two lists

Iterate alternatively over the elements of the list items1 and items2. For each iteration, print the element.

Explain what happens if items1 and items2 have different size.

Extra Keywords
parallel
Extra Keywords
parallel
Code
for pair in zip(item1, item2): print(pair)