""" lectureNote/chapters/chapt05/codes/try_except1.py try-except example, originally from https://docs.python.org/3/tutorial/errors.html """ while True: try: x = int(input("Please enter an integer: ")) print('The number you entered was = ', x) except ValueError: print("Oops! Could not invert your input to an integer. Try again...")