Create loop.py

Update fib.py

Create fib.py
This commit is contained in:
blueloveTH 2023-02-18 21:54:56 +08:00
parent f4248e25b1
commit df1150382d
2 changed files with 12 additions and 0 deletions

6
benchmarks/fib.py Normal file
View File

@ -0,0 +1,6 @@
def fib(n):
if n < 2:
return n
return fib(n-1) + fib(n-2)
assert fib(32) == 2178309

6
benchmarks/loop.py Normal file
View File

@ -0,0 +1,6 @@
x = 0
for i in range(5000000):
x += 1
assert x == 5000000