Tuple assignment in for : Tuple Loop « Tuple « Python






Tuple assignment in for

 

T = [(1, 2), (3, 4), (5, 6)] 
for (a, b) in T:                          # Tuple assignment at work
    print a, b 

   
  








Related examples in the same category

1.Iterate over a string and tuple
2.Create a tuple with some items and display with a for loopCreate a tuple with some items and display with a for loop