print ("What is/was your original purchase price?")
x = input
valx=float(x)
print ("Amount of original purchase: ${}"
.format(valx))
print ("State sales tax on original purchase: ${}"
.format(valx*.04))
print ("County sales tax on original purchase: ${}"
.format(valx*.02))
print ("Total sales tax (county and state): ${}"
.format(valx*.06))
print ("Total of the sale (original purchase and total sales tax): ${}"
.format(valx*.06))
这对我来说很有意义,我过去曾使用过这种方法,但它现在不起作用。
Output error: line 9, in <module>builtins.TypeError: float() argument must be a string or a number
基本上我的目标是显示原始购买的金额,原始购买的国家销售税(4%)金额,县销售税(2%)原始购买的金额,总销售税(县税加上州税),最后是销售总额(即原始购买金额加上总销售税的总和)。