forked from Rust-related/RustPython
@@ -1,11 +1,8 @@
|
||||
j = 0
|
||||
while j < 1000:
|
||||
|
||||
total = 0
|
||||
i = 0
|
||||
while i < 100:
|
||||
total += i
|
||||
i += 1
|
||||
# print(total)
|
||||
|
||||
j += 1
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
def fib(n):
|
||||
# a, b = 1, 1
|
||||
a = 1
|
||||
b = 1
|
||||
for _ in range(n-1):
|
||||
for _ in range(n - 1):
|
||||
temp = b
|
||||
b = a+b
|
||||
b = a + b
|
||||
a = temp
|
||||
|
||||
#a, b = b, a+b
|
||||
return b
|
||||
|
||||
print(fib(1))
|
||||
print(fib(2))
|
||||
print(fib(3))
|
||||
print(fib(4))
|
||||
print(fib(5))
|
||||
print(fib(5))
|
||||
Reference in New Issue
Block a user