Courseiva

PCEP

Full exam simulation

45:00
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)
0 of 15 answered