Bringing back the while loop

So, you may remember using the while loop back in Chapters 4, Making Decisions: Python Control Flows, and Chapter 5, Loops and Logic. We will be using the while loop again to set up the game loop. There is quite a lot happening in the game loop (the while loop), so let's take a look at it step by step. First, look at this screenshot of all of the code inside the game loop:

Bringing back the while loop

The first thing that you see is the comment telling anybody who reads the code what the code is doing. Comments are not required, but sometimes they can be helpful when you are writing a program. This comment simply tells us that the next section is ...

Get Python Projects for Kids 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.