def fangcha(): a=float(raw_input("请输入a:")
) b=float(raw_input("请输入b:")
) c=float(raw_input("请输入C:")
) d=(a+b+c)/3.
0 e=((a-d)**2+(b-d)**2+(c-d)**2)/3.
0 print "平均数是:%f方差是:%f" %(d,e) fangcha() Python2.7可用
def fangcha(): a=float(raw_input("请输入a:")
) b=float(raw_input("请输入b:")
) c=float(raw_input("请输入C:")
) d=(a+b+c)/3.
0 e=((a-d)**2+(b-d)**2+(c-d)**2)/3.
0 print "平均数是:%f方差是:%f" %(d,e) fangcha() Python2.7可用