I am trying to get this bit of code to work to validate the following input. I want to only accept inputs 1,2,or 3. Here is what I have so far:
number = int(input('Enter a number:'))
done = False
while not done:
try:
if number < 3:
done = True
except:
number = input("Please enter a valid number:")
The expected out put that I want if the input to loop until I get either 1,2, or 3. Right now it won't do anything to when I input something greater than three. I want to use this number as an input to another function. Any help would be great of if you need more information please let me know!