Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 74e94ab

Browse files
SandersLinpoyea
authored andcommitted
Create project Euler problem 25 sol2.py (TheAlgorithms#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

Lines changed: 10 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /