Vidyalelo
Python · Q40

Exception Handling in Python

Programming · Python · question 40

Q40

Compare the following two Python codes shown below and state the output if the input entered in each case is -6? CODE 1 import math num=int(input("Enter a number of whose factorial you want to find")) print(math.factorial(num)) CODE 2 num=int(input("Enter a number of whose factorial you want to find")) print(math.factorial(num))

A.
ValueError, NameError
Answer
B.
AttributeError, ValueError
C.
NameError, TypeError
D.
TypeError, ValueError

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board