Lesson 16 Quiz: Mini-Project: The Number-Guessing Game

Self-check only. Your answers stay in your browser — nothing is submitted or graded. Pick an answer for each question, then press Check my answers to see the answer key and explanations.

1. What does `random.randint(1, 10)` do, and why must `import random` come first?

2. What does `input()` give you, and why is `int()` needed on its answer?

3. What does `while True:` mean, and what stops such a loop?

4. Why is `==` checked before the too-low and too-high cases?

5. The game uses no new concept except `random`, `input`, and `break` — what does that tell you about building programs?

← Back to Lesson 16 · Enroll free in the full course