Loading...
Loading...
Loading...
A price list has one line per item with its price. Prices are updated by adding the item again, so if an item appears more than once, only its last price counts.
Print the total of the current prices, counting each item once.
Example
Input
3 mouse 25 keyboard 75 mouse 30
Output
105
Mouse counts at 30, so 30 + 75.
Try the problem first. Open one hint at a time.
A dictionary keeps one value per key.
Store each price under its item name, then add up the values.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor