Skip to content
← Python for AI/ML · all 50 levels

enumerate & zip

Level 30 of 50 · Data structures

Level 30 of 50

enumerate & zip

explained with roll call. Watch the reel, then work through it below: run the code, take the quiz, keep the cheat sheet.

📒 Open the cheat sheet
SanaRoll call! Hamza, number 1. Fatima, number 2!
TeacherNumbering by hand? enumerate counts for you!
roll.py
kids = ["Hamza", "Fatima"]
for n, k in enumerate(kids, 1):
    print(n, k)
Teacherenumerate gives you a number, and the item!
SanaWhat's that 1 at the end?
TeacherThe start number! Without it, counting starts at 0!
roll.py
kids = ["Hamza", "Fatima"]
marks = [88, 92]
for k, m in zip(kids, marks):
    print(k, m)
TeacherAnd zip? It pairs two lists, side by side!

⏸ Pause & predict: what prints?

c = ["Lhr", "Khi", "Isb"]
t = [41, 34]
n = 0
for x, y in zip(c, t):
    n += 1
print(n)

Where this leads

Python is step one. Building AI that ships is the rest.

The diploma takes you from zero to deployed computer vision, LLM and agent projects, with engineers who build them for a living. Already code? The bootcamp does it in three months.