I think the problem is the loop is not ending even when the right number is input. However, the line (while choice != a :) should prevent that, so I'm not sure what's wrong.
(while choice != a :)
import random a = random.randint(1, 9) choice = int(input("give me a number")) while choice != a : if choice > a: choice = int(input("You guessed too high. Please guess again")) elif choice < a: choice = int(input("You guessed to low. Please guess again")) print("You won")
1.4m articles
1.4m replys
5 comments
57.0k users