当先锋百科网

首页 1 2 3 4 5 6 7
number1 = float(raw_input('input number1:'))
number2=float(raw_input('input number2:'))
sum1=number1+number2
#print number1,'+',number2,'=',sum1
print '%.3f+%.3f=%.3f'%(number1,number2,sum1)


结果如下:


input number1:12.1

input number2:11
12.100+11.000=23.100

学习链接:

http://blog.163.com/njut_wangjian/blog/static/16579642520143222482847/

http://blog.csdn.net/ithomer/article/details/6196327