I have a try-except block in Python 3.3, and I want it to run indefinitely.
try: imp = int(input("Importance:\n\t1: High\n\t2: Normal\n\t3: Low")) except ValueError: imp = int(input("Please enter a number between 1 and 3:\n> ")
Currently, if the user needs to enter a non-integer, he will work as planned, however, if he had to enter it again, he will simply raise a ValueError and fail again.
What is the best way to fix this?
source share