M

Mr. Dubey • 100.28K Points
Coach

Q. What is the output of the below code?

Code:
def fun(n,res=1):

if(n<=0):

return res

return fun(n-1,n*res)

print(fun(5))
  • (A) 15
  • (B) 45
  • (C) 1
  • (D) 120
  • Correct Answer - Option(D)
  • Views: 148
  • Filed under category Python

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics