2023-07-29 11:12:39 -07:00

17 lines
337 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# author: bt3gl
def fibonacci(n):
""" Calculate the nth Fibonacci number """
if n == 0 or n == 1:
return n
return fibonacci(n - 1) + fibonacci(n - 2)
if __name__ == '__main__':
print('Testing fibonacci')
n = 10
print(f'Fibonacci of {n}: {fibonacci(n)}')