Nov-02-2017, 08:34 PM
Quote:mon = input("How many bottles did you return on Monday: ") is_valid = is_valid_integer(input_string) while not is_valid: mon = input("Nice try, please enter a whole number! ") is_valid = is_valid_integer(input_string)
You're checking if
input_string
is a number, but you never set input_string
, so it'll never be a number. Instead, you set mon
, but then never use mon
for anything.That's why you're stuck in the loop.