Bird
0
0

What is the output of the following code?

medium📝 Predict Output Q13 of 15
SciPy - Constants and Special Functions
What is the output of the following code?
from scipy.special import factorial
result = factorial(5, exact=True)
print(result)
A24
B5
C720
D120
Step-by-Step Solution
Solution:
  1. Step 1: Understand factorial(5) calculation

    Factorial of 5 is 1*2*3*4*5 = 120.
  2. Step 2: exact=True returns integer factorial

    Using exact=True returns the exact integer value, so result is 120.
  3. Final Answer:

    120 -> Option D
  4. Quick Check:

    factorial(5) = 120 [OK]
Quick Trick: Factorial 5 is 120, exact=True returns integer [OK]
Common Mistakes:
MISTAKES
  • Confusing factorial(5) with factorial(4)
  • Ignoring exact=True and expecting float
  • Mistaking factorial for sum

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes