I want to get a user input which is bigger than zero. If user enters anything else than a positive integer prompt him the message again until he does.
x = input("Enter a number:") y= int(x) while y<0: input("Enter a number:") if not y<0: break If I add a bad value first then a good one it just keeps asking for a new one. Like Try -2 it asks again but then I give 2 and its still asking. Why?
y = int(input("Enter a number:"))you need to assigninput()return value to a variable