aboutsummaryrefslogtreecommitdiff
path: root/entries/gonzalezf/fib.py
blob: 26d3a64a017b46b60de74a84391e18e8406f4cd7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
def fibonacci(n):
    if n == 1 or n == 0:
        return 1
    else:
        return fibonacci(n-1) + fibonacci(n-2)

    
def main():
    n = int(input('Insert n: '))
    print('Fibonacci (',n,') =', fibonacci(n))

if __name__ == "__main__":
    main()