O'Reilly logo

Hello World! Second Edition: Computer Programming for Kids and Other Beginners by Warren Sande and Carter Sande

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 8. Loop the Loop

For most people, doing the same thing over and over again is very boring, so why not let the computer do that for us? Computers never get bored, so they’re great at doing repetitive tasks. In this chapter, we’ll see how to make the computer repeat things.

Computer programs often repeat the same steps over and over again. This is called looping. There are two main kinds of loops:

  • Those that repeat a certain number of times—These are called counting loops.
  • Those that repeat until a certain thing happens—These are called conditional loops because they keep going as long as some condition is true.

Counting loops

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