Tuples & Unpacking in Python
Chapter 9: Tuples & Unpacking
3 short lessons, with 3D animations, quizzes and coding tasks.
The lessons
Tuples
A tuple is like a list written with round brackets ( ), but it can't be changed once it's made.
Unpacking
Unpacking gives the items of a tuple or list to several names at once, in order, one name for each item.
enumerate() and zip()
enumerate(items) gives (position, item) pairs, and zip(a, b) gives (item from a, item from b) pairs, side by side; you unpack each pair right in the for line.