python怎么进行小数的四则运算?并且可以自己定义小数点位数?
我现在只会整数的四则运算,如下:
a=int(raw_input('pleaseinputnumber1:'))
b=int(raw_input('pleaseinputnumber2:'))
print"the+oftheresultis:%sn
the-oftheresultis:%sn
the*oftheresultis:%sn
the/oftheresultis:%s"%(a+b,a-b,a*b,a/b)
因为int是整数,我不知道怎么进行小数的运算,求教!
邮箱:联系方式: