我写了一个简单的程序来计算一些电气部件的税,它是这样的:
print "How much does it cost?",
price = raw_input()
print "Tax: %s" % (price * 0.25)
print "Price including tax: %s" % (price * 1.25)
raw_input ("Press ENTER to exit")
我不断收到这个错误:
Traceback (most recent call last):
File "moms.py", line 3, in <module>
print "Tax: %s" % (price * 0.25)
TypeError: can't multiply sequence by non-int of type 'float'