Skip to content

Instantly share code, notes, and snippets.

@seniorpreacher
Created April 28, 2016 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seniorpreacher/87e0b98e3d034f0bd27ba5f0d5ec08ca to your computer and use it in GitHub Desktop.
Save seniorpreacher/87e0b98e3d034f0bd27ba5f0d5ec08ca to your computer and use it in GitHub Desktop.
Python - Fibonacci examples
number_count = 30
list = [0, 1]
for i in range(0, number_count - 2):
list.append(list[-1] + list[-2])
for j in list:
print j
number_count = 30
a, b = 0, 1
print a, "\n", b
for i in range(0, number_count - 2):
a, b = b, a + b
print b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment