Skip to content

Commit

Permalink
Create project Euler problem 25 sol2.py (TheAlgorithms#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
SandersLin authored and poyea committed Feb 20, 2019
1 parent 98a149e commit 74e94ab
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions project_euler/problem_25/sol2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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

0 comments on commit 74e94ab

Please sign in to comment.