def safe_input():
    while True:
        try:
            guess = int(input(prompt))
            return guess
        except ValueError:
            print("You must enter a valid value.")
Prompts the user for an integer and return only when a valid value
dataset/ETHPy150Open aroberge/pyproj/guess_number/guess_2.py/safe_input