13REPEATING FOR LOOPS

image

Have you ever noticed that no matter how many times you take out the trash, clean dirty dishes, and do laundry, you always have to do it again? What if you only had to do each task once, and then you created a robot version of yourself to do it every time after that? That would be amazing!

In the Small Basic universe, automating repetitive tasks is a breeze. You only have to write code for a repetitive task once, and then you can use a loop to repeat that task as many times as you need.

Small Basic uses two types of loop statements: For loops and While loops. In this chapter, you’ll learn about For loops, explore nested ...

Get Learn to Program with Small Basic 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.