In this Python challenge, let's make a "guess the number" game!
Using variables, data types, user input, conditional statements, and loops, the program will generate a random number and then ask the user to guess what the number is. When the user guesses wrong, the program will tell them if they are too high or too low until the correct number is guessed.
Here are some guidelines:
- Generate a random number between 1 and 100.
- Let the user guess what the number is until they get it right.
- Give the user feedback after each guess (tell them if their guess is too high, too low, or just right).
- Begin the game again.
To get started, create a new Python File called guessing_game. On line 1, write a comment to describe what you'll be working on.
Tip: You should add comments throughout your program. It helps to first break the problem down into steps. Then, add comments first to structure out where the code goes then add in the code!
Here is what your final code should look like: