A try...except...else...finally statement can have more than one except. Also, each except can have one or more statements that address specific errors. For example, instead of displaying the exception information, you can display a message that explains how to solve the problem.
except Exception as e: print("Exception = ", e) et = type(e) print("Exception type = ", et)
...with this:
except ZeroDivisionError: print("Can't divide by zero.") except TypeError: print("Expected a number.")
Now let's repeatt the tests three times, changing the value of d each time: