Files
RustPython/extra_tests/benchmarks/perf_fib.py
Rex Ledesma 4e2e0b41c6 chore: add ruff format --check (#5774)
* chore: add `ruff format --check`

* fix tests
2025-05-12 14:20:01 +09:00

17 lines
197 B
Python

def fib(n):
a = 1
b = 1
for _ in range(n - 1):
temp = b
b = a + b
a = temp
return b
print(fib(1))
print(fib(2))
print(fib(3))
print(fib(4))
print(fib(5))