I'm writing a code for a guessing game where the user can choose a range for the number to be in, the program will choose a random number, and the user can guess the number until they are correct.
I've tried using conditionals and a while loop but I cannot get it to run.
if (userGuess > targetNum):
print "\nToo high\n"
elif (userGuess < targetNum):
print "\nToo low\n"
else:
print "\nThat's it! Nice job!\n"
This program runs but I need help getting it to loop so that the user can input their guess and get feedback if it's too high or too low until they guess the correct number. Thanks