#!/usr/bin/python
#coding:utf-8
x=[0,1]
for i in range(10):
tmp=x[-1]+x[-2]
x.append(tmp)#追加
print x

python脚本-斐波那契数列

#!/usr/bin/python
#coding:utf-8
def jsq(x,y): #x,y形式参数
print "加法",x+y
print "乘法",x*y
print "除法",x/y
jsq(1,5) #1,5实际参数