Page 1 of 1

Compare the following two Python codes shown below and state the output if the input entered in each case is -6?

Posted: Wed Jul 13, 2022 7:45 pm
by answerhappygod
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
b) AttributeError, ValueError
c) NameError, TypeError
d) TypeError, ValueError