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))
this makes sense to me and I’ve used this method in the past, however it doesn’t work now.
Output error: line 9, in <module>builtins.TypeError: float() argument must be a string or a number
basically my goal is to display the amount of the original purchase, the amount of the state sales tax(4%) on the original purchase, the amount of the county sales tax(2%) original purchase, the total sales tax (county tax plus state tax), and final the total of the sale (which is the sum of the amount of the original purchase plus the total sales tax).
The way to retrieve input from the command line would be this:
inputis a string, and you convert it to a float by wrapping that call. You then don’t need the extra variable.