DEV Community

Python Week 3: We Stopped Repeating Ourselves (Loops!) (opens in new tab)

I started this session with a challenge. "Jose," I said, "print the names of all 40 students in this dataset - one per line." He looked at me. Then at his keyboard. Then started typing print("Amina"). I let him get to the third name before I stopped him. "What if there were 10,000 students?" Silence. "What if the list changed every week?" More silence. That's the setup for loops. You don't teach loops by explaining them - you first make people feel the pain of not having them. Then the soluti...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help