# Except block catches ValueErrors caused by non-numerical input def catch_error(): while True: try: x = int(raw_input("Input a number: ")) print "You input the number", x except ValueError: print "You did not input a number" # Raise Error Example def raise_error(): while True: try: x = raw_input("Type 'x' to crash the program: ") if x == 'x': raise RuntimeError print "You did not crash the program"