This language bar is your friend. Select your favorite languages!
Edit summary for version 11 :
[Ruby] shorter and more readable

Version 10

Version 11

Idiom #143 Iterate alternatively over two lists

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

Idiom #143 Iterate alternatively over two lists

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

Extra Keywords
parallel
Extra Keywords
parallel
Code
[items1, items2].transpose.each{|ar| 
  ar.each{|item| p item }
}
Code
items1.zip(items2){|pair| puts pair}