Kjj M.

asked • 02/11/24

Help writing a PYTHON program that generates a random number and the player tries to guess it.

  1. You wont be using any LOOPS, creating any Functions(other than using the random number generator) and NO MODULES at this point. Everything at this point is in sequence(Line-By-Line). You can add comments at the beginning of each block to explain what the code is doing.
  2. .
  3. import random (Generate random integers using Python randint() - AskPython )
  4. You want to add the code so the player can enter their name, then display a welcome message using their name welcoming them to the game. 
  5. The program should allow the player to try to guess the number that was randomly generated.
  6. Write the nested IF or Elif statements that checks if the player guessed the number, guessed too high or too low.
  7. Display a message indicating whether the player’s guess was "Correct", "Too High", or "Too Low within the IFs
  8. When your program ends, thank the person for playing and display "Game Over"
  9.  This is a one time guess at this point until we start using LOOPS.

PLEASE Help with this

2 Answers By Expert Tutors

By:

Yang W. answered • 02/11/24

Tutor
5 (16)

Data Scientist with 7+ Years of Experience in Python & R

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.