我正在制定一个程序,以查找已征税的金额并将其与小费结合在一起。
我正在研究小费和介绍。
代码:
print "Welcome \nEnter The Amount Of Money For the Transaction"
amount = raw_input
print "Taxed Amount Below\n"
taxed = (amount * float((1.065)))
print taxed
这就是我得到的:
>>> runfile('/home/meyer/.spyder2/temp.py', wdir='/home/meyer/.spyder2')
Welcome
Enter The Amount Of Money For the Transaction
Taxed Amount Below
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 699, in runfile
execfile(filename, namespace)
File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 81, in execfile
builtins.execfile(filename, *where)
File "/home/meyer/.spyder2/temp.py", line 8, in <module>
taxed = (amount * float((1.065)))
TypeError: unsupported operand type(s) for *: 'builtin_function_or_method' and 'float'
>>>
我知道我不能乘以这个浮点数,但是我找不到其他方法。甚至MPMath
我正在使用python 2.7
jeck猫
相关分类