MCQ Single Best Answer Not Set

QWhat will be the output after the following statements?
def abc(x):
    return 20 / x
print(abc(0))

ID: #3973 Python Errors and Exceptions Handling 314 views
Question Info
#3973Q ID
Not SetDifficulty
Python Errors and Exceptions HandlingTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A NameError
  • B Undefined
  • C 5.0
  • D ZeroDivisionError
Correct Answer: Option D

Explanation

ZeroDivisionError
---------------------------------------------------------------------------
ZeroDivisionError                         Traceback (most recent call last)
Input In [63], in ()
      1 def abc(x):
      2     return 20 / x
----> 3 print(abc(0))

Input In [63], in abc(x)
      1 def abc(x):
----> 2     return 20 / x

ZeroDivisionError: division by zero

Share This Question

Challenge a friend or share with your study group.