MCQs > IT & Programming > Python > Output of the following Python code? class Error(Exception): ''0...' pass class ValueTooSmallError(Error): '.'1uu' pass class ValueTooLargeError(Error): m2'... pass number = 10 while True: try: i_num =10 if i_num < number: raise ValueTooSmallError elif i_num > number: raise ValueTooLargeError break except ValueTooSmallError: print('1') printi) except ValueTooLargeError: print('1') printi) print('0')

Python MCQs

What will be the correct output of the following Python code?

class Error(Exception):

“"0..."

pass

class ValueTooSmallError(Error):

"."1uu"

pass

class ValueTooLargeError(Error):

m2"...

pass

number = 10

while True:

try:

i_num =10

if i_num < number:

raise ValueTooSmallError

elif i_num > number:

raise ValueTooLargeError

break

except ValueTooSmallError:

print("1")

printi)

except ValueTooLargeError:

print("1")

printi)

print("0")


Answer

Correct Answer:


Explanation:

Note: This Question is unanswered, help us to find answer for this one

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Python Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it