Pick the numeric type that matches the data before doing arithmetic. Python joins two strings when the operator is plus.
left = "7"
right = "3"
print(left + right) # 73
print(int(left) - int(right)) # 4Both lines use the same source text. Conversion lets the second expression subtract quantities.
A cart reads two prices as strings, including cents. Repair the last line to store their numeric sum in total. Keep the original text values.