LearnPy Hub
← Pandas: Cleaning & Preprocessing problems
Hard

Running Total by Date

Sort the orders by date and print each date with the running total of amount up to that order.

Input

Lines 'date region product amount', then END.

Output

Lines.

Sample 1

Input
2026-01-15 Dhaka Tea 500
2026-01-20 Sylhet Tea 300
2026-02-03 Dhaka Rice 1200
2026-02-18 Khulna Tea 450
2026-03-07 Sylhet Rice 800
2026-03-21 Dhaka Tea 650
END
Output
2026-01-15 500
2026-01-20 800
2026-02-03 2000
2026-02-18 2450
2026-03-07 3250
2026-03-21 3900

Sample 2

Input
2026-05-01 Dhaka Tea 100
END
Output
2026-05-01 100
solution.py
Output appears here
Running Total by Date · Python practice problem · LearnPy Hub