- 1
What is output of following code?
def func(n): if(n==1): return 1; else: return (n+func(n-1)) print(func(4))
3 Respuestas
+ 6
How about running it in the code editor??
+ 2
The answer is 10, but the question you should ask is why?
+ 1
It is a recursive function return sum of numbers upto given range