我輸入要獲取的銷售金額(按輸入)乘以定義的營業(yè)稅(0.08),然后打印總金額(營業(yè)稅乘以銷售金額)。我碰到這個錯誤。有人知道什么地方可能有問題或有什么建議嗎?salesAmount = raw_input (["Insert sale amount here \n"])['Insert sale amount here \n']20.99>>> salesTax = 0.08>>> totalAmount = salesAmount * salesTaxTraceback (most recent call last): File "<pyshell#57>", line 1, in <module> totalAmount = salesAmount * salesTaxTypeError: can't multiply sequence by non-int of type 'float'
為什么會出現(xiàn)TypeError:無法將序列乘以'float'類型的非整數(shù)?
ibeautiful
2019-11-18 17:59:22