Skip to content
dreamcode
dreamcode
Back to map
Enumerate & zip · Lesson 26 of 44
+15 XP on finish
PYTHON INTERMEDIATE

Enumerate and zip

enumerate() yields index-value pairs during iteration. zip() pairs up elements from multiple lists in parallel.

How it reads
enumerate(names) yields index and value pairs
zip(names, scores) pairs up elements from lists in parallel
Cloud tip: zip() stops pairing as soon as the shortest input list is exhausted.
main.py
PYTHON
real Python, runs in your browser
CONSOLE
- run your code to see output -