Oct-01-2016, 03:37 PM
i am trying to get a while loop to repeat in my number guessing game and i dont kn
import random print ("this is the number guessing game") x=int(input("What is the min number? ")) s=int(input("What is the max number? ")) num=random.randrange(x,s) guesses= int(input("how many guesses? ")) i=0 while guesses>0 or guess!=num or i==1: guess =int(input("take a guess " )) if guess>num: print ("to high you have",guesses-1,"guesses left") guesses-=1 elif guess<num: print ("to low.you have",guesses-1,"guesses remaning") guesses-=1 else: print ("congrats you guessed the number") break if guesses==0: break if guess!=num: print("you have not guessed the number.it was",num,) else: print ("you have completed the game") o=int(input("press 1 to play agin")) if o==1: i+=1 how do i get it to work?? thanks for any helpow what im doing wrong