# simple fibonacci series # the sum of two elements defines the next set a, b = 2, 9 while b < 100: print(b+a) a, b = a+b, a + b #double if a+b # 9 # 9 # 9+9=18 # 18+9=27 # 27+18=45 a+b = ref to past past # 45+27=72 b,=past #base # 9+1=10 the one only interferes with the beginnging thats it #if you include a in print then change # 10+9=19 # 19+10=29 # 29+19=48 # 48+29=77 #base 9+2= 11 # 9 +9+2= 20 # 20 11 = 31 # 31 +20=51 # 51 +31
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