Chapter 5, Loops and Logic

Questions

Answers

Q1. What is a Boolean?

A statement that is either True or False

Q2. Why are global variables helpful?

Choice 2 and 3

Q3. for loops are similar to while loops. How is a for loop different from a while loop?

for loops are used to loop a specified number of times

Q4. What would be a good time to use a while loop in a game?

to keep a game going while a certain condition is True

Q5. What symbol is used to write comments in the code that are not a part of the code?

#

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.