Parsing & Adding Client Data
Data:
('Client 1', '13.2')
('Client 1', '22.4')
('Client 1', '1.2')
('Client 2', '3.4')
('Client 3', '12.3')
('Client 3', '3.221')
('Client 4', '234.44')
Trying to write the proper loop and adding feature to get the right output.
Goal Result:
Client 1: 36.8
Client 2: 3.4
Client 3: 15.521
Client 4: 234.44
This is the code I finally got to list the data correctly. Where do I go from here to get the result. I have tried a number of different loops with no success.
import csv
with open('clientdata.csv') as csvfile:
reader = csv.DictReader(csvfile)
numbers = []
for row in reader:
print(row['Client Name'], row['Earnings'])