Codington
0 of 6 problems solved • 0%

Exercise prompt

Repair a Text Total

Pick the numeric type that matches the data before doing arithmetic. Python joins two strings when the operator is plus.

Example

left = "7" right = "3" print(left + right) # 73 print(int(left) - int(right)) # 4

Both lines use the same source text. Conversion lets the second expression subtract quantities.

Your task

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.