निम्नलिखित का आउटपुट क्या होगा पायथन कोड?
What will be the output of the following Python code ?
from math import factorial
print(math.factorial(5)) A
120
B
Nothing is printed
C
Error, method factorial doesn’t exist in math module
D
Error, the statement should be : print(factorial(5))
Explanation
Sure!
- You imported
factorialdirectly, so you should usefactorial(5), notmath.factorial(5). - Using
math.factorial(5)will give an error becausemathwasn't imported.
Answer: (D) Error, the statement should be: print(factorial(5)).
Correct Answer: D) Error, the statement should be : print(factorial(5))