Track 4 · Lesson 9 of 11
enumerate() and zip(): positions and parallel data
Get each item together with its position using enumerate(), and walk through two sequences side by side with zip().
You will be able to
- Number items with enumerate(), starting from 0 or from 1
- Unpack two loop variables in a for statement
- Loop over two related sequences together with zip()
- Explain what zip() does when the sequences have different lengths
Included with a Formula Quest membership
It has 4 graded exercises with feedback, hints and solutions. Python Quest is included in Formula Quest memberships that cover Python; membership and billing are managed on Formula Quest.
View Formula Quest memberships
Tracks 1 and 2, the first lesson of every track, the playground and the dataset library are free.