Why would you do a while True and then break out of this loop while you can also just put your requirements in the while statement since all you want is to stop once you have the age?
age = None while age is None: input_value = input("Please enter your age: ") try: # try and convert the string input to a number age = int(input_value) except ValueError: # tell the user off print("{input} is not a number, please enter a number only".format(input=input_value)) if age >= 18: print("You are able to vote in the United States!") else: print("You are not able to vote in the United States.") This would result in the following:
Please enter your age: *potato* potato is not a number, please enter a number only Please enter your age: *5* You are not able to vote in the United States. Please enter your age: potato potato is not a number, please enter a number only Please enter your age: 5 You are not able to vote in the United States. this will work since age will never have a value that will not make sense and the code follows the logic of your "business process"