mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-12-01 00:41:09 +00:00
11 lines
184 B
Python
11 lines
184 B
Python
|
def fibonacci_genrator():
|
||
|
a, b = 0,1
|
||
|
while True:
|
||
|
a,b = b,a+b
|
||
|
yield b
|
||
|
answer = 1
|
||
|
gen = fibonacci_genrator()
|
||
|
while len(str(next(gen))) < 1000:
|
||
|
answer += 1
|
||
|
assert answer+1 == 4782
|