© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
J. R. PaynePython for Teenagershttps://doi.org/10.1007/978-1-4842-9988-3_5

5. Loops and Logic

James R. Payne1  
(1)
Gainesville, GA, USA
 

Sometimes fighting crime can make you feel like you are running around in circles. Day in and day out you seem to have to tackle the same struggles: a bank robber here, a cat stuck in a tree over there, an evil genius trying to take over the universe. It is almost as if you are stuck in some sort of…loop.

While being stuck in a proverbial Groundhog Day – a day that repeats itself over and over and an excellent flick starring Bill Murray (ask your parents) – is a bad thing, using loops in your computer programs can be a

Get Python for Teenagers: Learn to Program like a Superhero! now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.