Python - zip()
📖 Read the lesson
Code Life
By Pierre Marsaa
The Problem
Imagine you have two separate lists — Codémon names and their levels — and you want to pair them up. You could use
range
(
len
(...))
but that's clunky.
↗️
Loading editor...
↶
▶️ Run
↷
This works, but it's not very
Pythonic
. Python has a cleaner way:
zip
()
! Let's see how it works.
Verify