Last active
March 11, 2018 20:10
-
-
Save andrewphillipdoss/400563992fc3c028b4049200ad999ae4 to your computer and use it in GitHub Desktop.
Write a script that Prints Fibonacci Series numbers till 10,000
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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