Quick actions

cmd+k|ctrl+k

Navigation

Languages

nthfibseries

Snippet info

Language

Python

Visibility

public

Author

mdirfan19962

Created

2020-06-10T05:28:31Z

Updated

2020-06-10T05:28:31Z

def nthseries(n):
    if n < 1:
        return "Incorrect input"
    elif n == 1:
        return 0
    elif n == 2:
        return 1
    elif n > 2:
        return nthseries(n-1)+nthseries(n-2)
        
print(f"n th fib series is {nthseries(9)}")
INFO