A Number-Guessing Game

Modify your silly number-guessing game to actually pick a random number from 1 to 10 and have the user try to guess that. Tell them if they get it right or wrong, and if they get it wrong, show them what the random number was.

They will still only get one try.

Name the file: number_guessing_game.py

I'm thinking of a number from 1 to 10.
Your guess: 3

Sorry, but I was really thinking of 4.
I'm thinking of a number from 1 to 10.
Your guess: 4

Sorry, but I was really thinking of 7.
I'm thinking of a number from 1 to 10.
Your guess: 2

That's right!  My secret number was 2!

©2021 Daniel Gallo

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.

Creative Commons License

Adapted for Python from Graham Mitchell’s Programming By Doing