Skip to content

Commit 74e94ab

Browse files
SandersLinpoyea
authored andcommitted
Create project Euler problem 25 sol2.py (#658)
1 parent 98a149e commit 74e94ab

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

project_euler/problem_25/sol2.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def fibonacci_genrator():
2+
a, b = 0,1
3+
while True:
4+
a,b = b,a+b
5+
yield b
6+
answer = 1
7+
gen = fibonacci_genrator()
8+
while len(str(next(gen))) < 1000:
9+
answer += 1
10+
assert answer+1 == 4782

0 commit comments

Comments
 (0)