i=1 #Define i i1=1 #i1 is the first number i2=1 #i2 is the sencond number i3=1 #i3 is the tird number number=int(input("how many interation would you like")) #Ask the user for interger input print(i1) #using print python print the number print(i2) print(i3) while (i<=(number-2)): #formula i4=i1+i2+i3 #It tells pythan to add first, second, and tird number to make 4th number print(i3) # ask python to print the answer i1=i2 # i2=i3 i3=i4 i=i+1 print("all done") # tell pythan to print all done after they finish their caculation
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question