Loop over multiple arrays simultaneously: Difference between revisions
Content deleted Content added
m →{{header|Ruby}}: another method |
|||
Line 26: | Line 26: | ||
=={{header|Ruby}}== |
=={{header|Ruby}}== |
||
<lang ruby>['a','b','c'].zip(['A','B','C'], [1,2,3]).each {|i,j,k| puts "#{i}#{j}#{k}"}</lang> |
<lang ruby>['a','b','c'].zip(['A','B','C'], [1,2,3]).each {|i,j,k| puts "#{i}#{j}#{k}"}</lang> |
||
or |
|||
<lang ruby>['a','b','c'].zip(['A','B','C'], [1,2,3]).each {|a| puts a.join('')}</lang> |
|||
=={{header|Tcl}}== |
=={{header|Tcl}}== |