nxSnippet001

*Fibonacci in popular languages:* http://www.scriptol.org/fibonacci-any-programming-language.html

Python Code

# nxSnippet001.py
# Fibonacci
# 2009.01.31
 
primer = 300
scale_range = 16
a = 0.2
b = 0.8
sum_scale = []
scale = []
 
for i in range(scale_range):
 
    sum_scale.append(b)
    scale.append(b+primer)
    a, b = b, a+b
 
print sum_scale
print scale

CodePad Link: http://codepad.org/bMAhwrc5

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License