Loop Through a Tuple
You can loop through the tuple items by using a for
loop.
Example
Iterate through the items and print the values:
thistuple = ("apple", "banana", "cherry")
for x in thistuple:
print(x)
You can loop through the tuple items by using a for
loop.
Iterate through the items and print the values:
thistuple = ("apple", "banana", "cherry")
for x in thistuple:
print(x)