Write a function to compute: f(n)=f(n-1)+100 when n>0 and f(0)=1 with a given n input by input parameters.


Topic: Write a function to compute: f(n)=f(n-1)+100 when n>0 and f(0)=1 with a given n input by input parameters.

Solution

def f(n):
    if n==0:
        return 0
    else:
        return f(n-1)+100



List all Python Programs