Bird
0
0

What is the output of this code?

medium📝 Predict Output Q5 of 15
SciPy - Constants and Special Functions
What is the output of this code?
from scipy.special import gamma
print(gamma(6))
A720.0
B120.0
C24.0
D6.0
Step-by-Step Solution
Solution:
  1. Step 1: Recall gamma function relation

    Gamma(n) = (n-1)! for positive integers n.
  2. Step 2: Calculate gamma(6)

    gamma(6) = 5! = 120.0 as float.
  3. Final Answer:

    120.0 -> Option B
  4. Quick Check:

    gamma(6) = 120.0 [OK]
Quick Trick: Gamma(n) = (n-1)! for positive integers n [OK]
Common Mistakes:
MISTAKES
  • Using factorial(n) instead of (n-1)!
  • Expecting integer output
  • Confusing gamma(6) with factorial(6)

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes