mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-19 00:37:02 +00:00
Updated sol2.py to make it work as expected
This commit is contained in:
parent
8727246ed7
commit
16cd42c26c
|
@ -1,13 +1,12 @@
|
||||||
def fib(n):
|
def fib(n):
|
||||||
ls = []
|
a, b, s = 0, 1, 0
|
||||||
a,b = 0,1
|
while b < n:
|
||||||
n += 1
|
if b % 2 == 0 and b < n: s += b
|
||||||
for i in range(n):
|
a, b = b, a+b
|
||||||
if (b % 2 == 0):
|
ls.append(s)
|
||||||
ls.append(b)
|
|
||||||
else:
|
T = int(input().strip())
|
||||||
pass
|
ls = []
|
||||||
a,b = b, a+b
|
for _ in range(T):
|
||||||
print (sum(ls))
|
fib(int(input().strip()))
|
||||||
return None
|
print(*ls, sep = '\n')
|
||||||
fib(10)
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user