Guess what? You’re going to create a game where the computer chooses a number and the player guesses the number.
This project teaches you how to get input from the user and how numbers work in Python (they’re different from strings). You create a random number and in the process reuse someone else’s code in your own projects. You also do a little bit of debugging and tracking down logical errors.
In the guessing game, Python thinks of a random number. The player guesses the number.
If you did Project 2, you already know how to tell the player something — that’s what print is for. However, what you don’t know about the game at the moment is how to get Python to think of a random number, or how to get a guess from the player.
In practice, your program will always need some kind of input from the user. You’re still using the command line right now, so text is the only way to get input. You get text from a user by ...