LearnPy Hub
← Classes & Objects problems
Easy

A List of Objects

Write class Item with a name and price. Read n lines of name price, make a list of Items and print the total price.

Input

n, then n lines.

Output

One integer.

Sample 1

Input
2
tea 20
cake 80
Output
100

Sample 2

Input
1
pen 12
Output
12
solution.py
Output appears here
A List of Objects · Python practice problem · LearnPy Hub