All problems

Rotating a Pie Chart's Starting Angle

easyPythonMatplotlibPie Chart

Calder & Voss has a house rule for these circles: the first wedge must begin at the top of the clock face rather than at three o'clock, because readers start at twelve and work round from there. The rotation is a reading aid and touches nothing in the data. What the reviewer actually checks before signing a slide off is the total printed underneath — a circle claims the parts make up a whole, and if they do not, the circle is the wrong picture no matter how it is turned.

Task: Print the total of all the values in the list.

Input

The first line holds an integer n, the number of categories. Each of the next n lines holds a category name, one word with no spaces, then its value, separated by a single space. Values may have decimals. n is at least 1.

Output

One line holding the total, printed as Python prints the number it built: a total of sixty comes out as 60.0, never as 60 and never as 60.00.

Example:

Input:
3
A 10
B 20
C 30

Output:
60.0

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…