how python recession function gives 16 as output?

Viewed 23
def fun(n):
    if(n == 4):
        return n
    else:
        return 2*fun(n+1)


print(fun(2))

when n=4 it should retrun 4 , how it returns 16

0 Answers
Related