Skip to content

Commit

Permalink
Merge pull request #9 from Fauer4Effect/master
Browse files Browse the repository at this point in the history
Create fibonacci.py
  • Loading branch information
anmolrishi authored Oct 25, 2018
2 parents 2751a24 + 1668523 commit c7f6ef7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions fibonacci.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
num = int(input("How many fibonacci numbers?")

def fib(n):
a, b = 0, 1
for _ in range(n):
yield a
a, b = b, a + b

print(list(fib(num)))

0 comments on commit c7f6ef7

Please sign in to comment.