import time
import random
# USER CHOOSES TO PLAY
play = input("Type 'Play' to play")
while play == "play":
# COMPUTER GENERATES NUMBER
number = random.randint(1,11)
# USER GOES TO GUESS THE NUMBER
print ("guess the number, the computer has picked a number between 1 and 10. You have 5 tries")
num_guess = int(input())
# CODE TELLS USER IF THEY CHOOSES THE RIGHT OR WRONG NUMBERPL
if num_guess == number:
print(f"Yes the number is {number}, good job!")
elif num_guess != number:
for numguesses in range (4, 0, -1):
num_guess = int(input(f"guess the number you have {numguesses} tries"))
play = input("Type 'Play' to play")
i have no idea whether when the computer generates a number with 'random.randint' if it is generating a new number every time i guess what number it has generated (as this is a number generating game). Please can you help and let me know.
Im trying to make it so there is only 1 number generated, from 1,11, and i have 5 guess to guess the right number, then it repeats if the user types 'play'