Trying to make Guessing number game
I am a beginner in learning python 3. I am trying to make the guessing number game to increase my understanding in python. However I find some problem in the coding. Can u guys improve or tell me where did I go wrong here: import random import time minimum=1 maximum=10 generating_number=True guessing_section=True print("The Guessing Number Game") print("Computer will generate a number and you have to guess it. \nThe range is 1 to 10") response=input("Do you want to play? (Answer yes or no)") while response not in ["yes","no"]: response=input("Invalid input. Answer with yes or no :") if response== "yes": generating_number==True elif response=="no": generating_number=False print("Bye-bye dear friend") while generating_number: print("Game Starts") print("Generating a number.....") time.sleep(random.randint (1,5))#wait between 1 to 4 seconds randomly result=random.randint(minimum, maximum) print(result) generating_number=False player_guess =int(input("Number has been generated. You can make a guess now.")) while guessing_section: if player_guess>result: print("Your guess is too high.") elif player_guess<result: print("Your guess is too low.") elif player_guess==result: print("Congratulation! Your answer is correct") play_again=input("Do you want to play again? (Yes or no)") if play_again=="yes": generating_number=True elif play_again=="no": generating_number=False print("Bye-bye. It is fun to play with you") break