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