πŸ“Š Python
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
πŸ’¬ Discuss
βœ… Correct Answer: (D) 120

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
177
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
90%
Success Rate