This language bar is your friend. Select your favorite languages!

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.

#Edit dateEdit SummaryEditor
👁 Δ 20 2019-01-08, 16:52 New Pascal implementation by user [Bart] Bart
👁 Δ 19 2018-04-02, 21:26 Restored version 17 programming-idioms.org
👁 Δ 18 2018-04-02, 21:25 Restored version 16 programming-idioms.org
👁 Δ 17 2018-04-02, 20:34 [Ruby] typo steenslag
👁 Δ 16 2018-04-02, 20:34 [Ruby] added comment steenslag
👁 Δ 15 2018-03-27, 11:56 [Python] Add comments to explain what will happen if the lengths are not the same. Xris
👁 Δ 14 2018-03-27, 11:50 New Rust implementation by user [Xris] Xris
👁 Δ 13 2018-03-27, 11:45 New Python implementation by user [Xris] Xris
👁 Δ 12 2018-03-24, 17:31 Explain what happens if items1 and items2 have different size. programming-idioms.org
👁 Δ 11 2018-03-23, 22:59 [Ruby] shorter and more readable steenslag
👁 Δ 10 2017-09-12, 15:27 New Haskell implementation by user [Algorhythmus] Algorhythmus
👁 Δ 9 2017-08-21, 19:30 Linked to idiom #163 [Print list elements by group of 2] programming-idioms.org
👁 Δ 8 2017-06-14, 15:33 New Scheme implementation by user [Dodopod] Dodopod
👁 Δ 7 2016-08-26, 14:37 New Go implementation by user [programming-idioms.org] programming-idioms.org
👁 Δ 6 2016-08-25, 22:29 [Ruby] did not fit on one line steenslag
👁 Δ 5 2016-08-25, 22:26 New Ruby implementation by user [steenslag] steenslag
👁 Δ 4 2016-08-14, 21:10 Typo in title, +keyword parallel programming-idioms.org
👁 Δ 3 2016-08-14, 21:05 Linked to idiom #141 [Iterate in sequence over two lists] BBaz
👁 Δ 2 2016-08-14, 20:16 [D] remove null sentinel BBaz
1 2016-08-14, 20:16 Idiom creation by user [BBaz] BBaz