Hi: I’m doing this simple calculation of a 20% discount with three variables, but I can’t find the error:
price = 1.20
discount = price * 20 // 100
total = price - discount
print("%2.2f" % total)
The output in this case is the original price:
1.20
And in the terminal:
>>> price = 1.20
>>> discount = price * 20 // 100
>>> total = price - discount
>>> print(total)
1.2
>>> print(discount)
0.0
It’s as if discount and total don’t compute anything…it’s must be something obvious that I can’t see.
Thanks!