Python Loop Through a Tuple
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)
Try it Yourself »
for x in thistuple:
print(x)
You can learn more about for loops in our Python For Loops Chapter.
Related Pages
Python Tuples Tutorial Tuple Access Tuple Items Change Tuple Item Check if Tuple Item Exists Tuple Length Tuple With One Item Remove Tuple Items Join Two Tuples