1
Data Types, Variables, Basic I/O and Operators
medium
What is the output when the following code is executed?
try:
print(1/0)except ZeroDivisionError:
print("Cannot divide by zero")Exhibit
Refer to the exhibit.
def divide(a, b):
try:
result = a / b
print('Result:', result)
except ZeroDivisionError:
print('Cannot divide by zero')
except TypeError:
print('Unsupported operand')
divide(10, 0)