Practice Python

Beginner Python exercises

10 April 2014

Guessing Game One Solutions

Exercise 9

Generate a random number between 1 and 9 (including 1 and 9). Ask the user to guess the number, then tell them whether they guessed too low, too high, or exactly right. (Hint: remember to use the user input lessons from the very first exercise).

Extras:

Sample solution

Great example of a solution including both extras!

And another:

And another, with lots of helpful text!

Enjoying Practice Python?


Explore Yubico
Explore Yubico
comments powered by Disqus