# File: divby0ex2.py # See what happens when you divide by 0 # do it for an integer and a string # # Matt Bishop, MHI 289I, Fall 2023 # # # this can be any integer # -- if you want to see the difference between the two catches, # set this to a string like 'hello' x = 7 # # And here you catch *only* the division by zero or a type error try: y = x / 0 except ZeroDivisionError: print("You can't divide by 0!") print("Really, you can't!") except TypeError: print("You can't divide these types!")