Skip to content

Instantly share code, notes, and snippets.

@komuw
Last active August 29, 2015 14:05
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 komuw/0527faa1b95d3d4a4946 to your computer and use it in GitHub Desktop.
Save komuw/0527faa1b95d3d4a4946 to your computer and use it in GitHub Desktop.
#python script for fibonacci between 1 and 100
#example: 1,2,3,5,8,13
hold=[]
temp1 = 1
temp2 = 2
hold.append(temp1); hold.append(temp2)
for i in range(3, 101):
temp3 = temp1 + temp2
hold.append(temp3)
temp1 = temp2
temp2 = temp3
for i in hold:
print i,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment