Skip to content

Instantly share code, notes, and snippets.

@andrewphillipdoss
Last active March 11, 2018 20:10
Show Gist options
  • Save andrewphillipdoss/400563992fc3c028b4049200ad999ae4 to your computer and use it in GitHub Desktop.
Save andrewphillipdoss/400563992fc3c028b4049200ad999ae4 to your computer and use it in GitHub Desktop.
Write a script that Prints Fibonacci Series numbers till 10,000
fibonacci = [1,1] #start fibonacci with the first two elements
i = 1 #start iterator at second number in the series
while (fibonacci[i] + fibonacci[i-1]) < 10000: #while the number to be appeneded is less than 10 grand
fibonacci.append(fibonacci[i] + fibonacci[i-1]) #append the number
i += 1 #increment the iterator
print(fibonacci) #print the list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment