【发布时间】:2010-10-03 21:38:52
【问题描述】:
我正在输入一个销售金额(通过输入)乘以定义的销售税 (0.08),然后让它打印总金额(销售税乘以销售金额)。
我遇到了这个错误。任何人都知道可能出了什么问题或有任何建议吗?
salesAmount = raw_input (["Insert sale amount here \n"])
['Insert sale amount here \n']20.99
>>> salesTax = 0.08
>>> totalAmount = salesAmount * salesTax
Traceback (most recent call last):
File "<pyshell#57>", line 1, in <module>
totalAmount = salesAmount * salesTax
TypeError: can't multiply sequence by non-int of type 'float'
【问题讨论】:
标签: python