Pytest a nice Fibonacci example


This is a nice implementation of the Fibonacci function. If we look at the way we can use it we see that it works well for 10.

examples/pytest/fib1/fibonacci.py
def fib(n):
    a, b = 1, 1
    for _ in range(1, n):
        a, b = b, a+b
    return a

examples/pytest/fib1/use_fib.py
from fibonacci import fib

print(fib(10))

55