Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Tuple basics
7. Iterating over tuples
Tuples in functions


Very well done! To iterate over a tuple, you can use a for loop:

user_data = ('John', 'Smith', 29, 1.85, 'British')
for item in user_data:

This uses a simple for loop to print each item of the tuple on a new line.


For each item in the train_connection tuple, print the following line:

Train connection data of type {x} found: {item}

Replace {x} with the method call type(item).

Stuck? Here's a hint!

Inside the for loop, use:

print('Train connection data of type', type(item), 'found:', item)