What this lesson teaches
Python programming variables loops conditionals.
Write a Python number guessing game!
Sign in to start the full activity flow, save this lesson, print a learner version, and track XP. The preview below is public so parents and educators can evaluate the activity before joining.
Python programming variables loops conditionals.
A game with real input and output gives students immediate evidence that their code is doing what they intended. The combination of variables, conditionals, and loops in one short project mirrors the structure of all longer programmes — making this the most efficient introduction to computational thinking.
1. Import random. 2. Generate secret number. 3. While loop for guesses. 4. Check high or low. 5. Count guesses.