Exception HandlingTry-Except Block#try: doSmth()except: print("Error!")CopyRaising Exceptions#if x > 0: raise RuntimeError("Input cannot be greater than zero.")else: doSmth();CopyCreating Your Own Exceptions#class ValueTooLargeError(Error): """Raised when the input value is too large""" pass # Main Programif x > 0: raise ValueTooLargeErrorCopy