LearnPy Hub
← Inheritance & Special Methods problems
Medium

Adding Money Objects

Write class Money holding taka and poisha (100 poisha = 1 taka), with __add__ returning a new Money that carries over the poisha, and __str__ as T Tk P p. Read n amounts taka poisha and print their sum.

Input

n, then n lines.

Output

One line.

Sample 1

Input
2
10 50
5 75
Output
16 Tk 25 p

Sample 2

Input
1
0 99
Output
0 Tk 99 p
solution.py
Output appears here
Adding Money Objects · Python practice problem · LearnPy Hub