Python From Scratch podcast

Episode 9: Repeating Until Done (While Loops & User Input)

0:00
7:48
Rewind 15 seconds
Fast Forward 15 seconds

Welcome to Season 2 of PYTHON_FROM_SCRATCH!


Think about stirring a pot of gravy on the stove. You don't stir it exactly 47 times; you keep stirring UNTIL the lumps are gone. Today, we leave fixed For Loops behind and learn how to use While Loops and User Input to keep our Python programs running until a specific condition is met!


⏱️ CHAPTERS:

0:00 - The Stirring Analogy (Why we need While Loops)

1:35 - Getting Data from the User (input)

2:50 - The "Keep Going Until" Loop (while)

4:15 - The Infinite Loop Trap

5:10 - 10-Second Commuter Challenge

6:00 - Next Up: F-Strings (Episode 10)


🧠 COMMUTER CHALLENGE:

If we set `energy = 3`, and write `while energy > 0: print('Running')`, but we forget to subtract 1 from `energy` inside the loop... what happens when we run the program? Drop your answer in the comments!


---

⚖️ DISCLOSURES & NOTICES:

  • ​Voice & Production: This audio/video production utilizes synthetically generated AI voices alongside original instructional design.
  • ​Commercial Rights: Audio and synthetic voice tracks are licensed for commercial distribution and monetization.


#Python #LearnPython #Programming #PythonFromScratch #WhileLoop #CodingForBeginners

More episodes from "Python From Scratch"