So I'm creating a part of my program that raises a error when the user doesn't input a integer. Below is my code...
try:
pw_length_ask = int(raw_input("How long would you like your password to be? "))
final_pw_length = pw_length + int(pw_length_ask.strip())
print("Pass length set to " + str(final_pw_length))
except ValueError:
print("You must enter a number.")
int(raw_input("How long would you like your password to be? "))
It works great until the user is asked to enter a number again...
It just throws a ValueError then crashes. So how do I make it so that instead of giving the Value Error it repeats the question until the user gives correct input?