I have the following simple python code, which checks the user input.
while True:
num = raw_input("Enter the number :")
if (num >= 1 and num <= 5):
break
else:
print "Error! Enter again :"
When I give as input 0
or numbers greater than 5
it works correctly, but then I try to give an input from 1
to 5
and the program still goes to the else
part. Could you help me to find my error?