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