Let's say I get a list, and I want to iterate on three at a time. I.e.: I have a list with [1,4,5,6,7,8,-9,2,0]
In TCL, I can just use (for example):
foreach { x y z } $list {
puts "x is ${x}"
puts "y is ${y}"
puts "z is ${z}"
}
How can I define more than 1 variable, using the for loop with the in (array name) in Python 3.3? The Python org wiki showed just example of 1 iteration variable. This is also easily done in Ruby
Thanks.
EDIT: The expected output is:
x is 1
y is 4
z is 5
x is 6
y is 7
z is 8
x is -9
y is 2
z is 0