Instruction
All right, it's time to wrap things up! Let's have a quick summary of what we've learned before we move on:
- Tuples are frequently used to return multiple values from a function.
- Tuples as function result types are often unpacked into multiple variables.
- Use underscores to ignore certain values.
- Tuples often represent real-world objects ...
- ... or certain states/positions.
- Tuples are often used in conjunction with lists.
- To compare two lists element by element, we can use the
zip()function.
def get_min_max(input_list): ... return (min, max)
list_min, list_max = get_min_max(user_list)
_, list_max = get_min_max(user_list)
person = ('Mark', 28, 'Spanish')
x_y_coordinates = (5, -14)
people = [
('Mark', 28, 'Spanish'),
('Miranda', 21, 'ZEA')
]
for pair in zip(list_1, list_2):
if pair[0] == pair[1]:
...
Ok! How about a short quiz now?
Exercise
Click to continue.



