Iterate over a string and tuple : Tuple Loop « Tuple « Python






Iterate over a string and tuple

 

S = "lumberjack" 
T = ("and", "I'm", "okay") 

for x in S: print x,                      # Iterate over a string
for x in T: print x,                      # Iterate over a tuple

   
  








Related examples in the same category

1.Tuple assignment in for
2.Create a tuple with some items and display with a for loopCreate a tuple with some items and display with a for loop