来自李江的问题
python怎么进行小数的四则运算?并且可以自己定义小数点位数?我现在只会整数的四则运算,如下:a=int(raw_input('pleaseinputnumber1:'))b=int(raw_input('pleaseinputnumber2:'))print"the+oftheresultis:%snthe-
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是整数,我不知道怎么进行小数的运算,求教!
1回答
2019-12-25 06:53