Basically it's a guessing game and I have literally all the code except for the last part where it asks if the user wants to play again. how do I code that, I use a while loop correct?
heres my code:
import random
number=random.randint(1,1000)
count=1
guess= eval(input("Enter your guess between 1 and 1000 "))while guess !=number:
count+=1if guess > number + 10:print("Too high!")elif guess < number - 10:print("Too low!")elif guess > number:print("Getting warm but still high!")elif guess < number:print("Getting warm but still Low!")guess = eval(input("Try again "))
print("You rock! You guessed the number in" , count , "tries!")while guess == number:count=1again=str(input("Do you want to play again, type yes or no "))
if again == yes:
guess= eval(input("Enter your guess between 1 and 1000 "))
if again == no:
break