O'Reilly logo

Python for Kids by Jason R. Briggs

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Going Loopy

Nothing is worse than having to do the same thing over and over again. There’s a reason why some people count sheep when they’re having trouble falling asleep, and it has nothing to do with the amazing sleep-inducing powers of woolly mammals. It’s because endlessly repeating something is boring, and your mind can drop off to sleep more easily if you’re not focusing on something interesting.

Programmers don’t particularly like repeating themselves either, unless they’re also trying to fall asleep. Thankfully, most programming languages have what is called a for loop, which repeats things like other programming statements and blocks of code automatically.

In this chapter, we’ll look at for loops, as well as another type of loop ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required