assignment
Budget: $10 – $30 USD
Write a python code on below problem :
Write a program that parses the data as specified below :
data = """
1,Sweden,10
2,Finland,14
3,Denmark,4
4,Sweden,3
5,Sweden,90
6,Norway,45
7,Finland,2
"""
And outputs each country with how many times it appears in the data and the sum of the numbers to right of it, like this:
Sweden 3 103
Finland 2 16
Denmark 1 4
Norway 1 45
Your program should not hard code the countries, i.e. if a country is added later in data the program should still produce the correct output (with the new country).
Write a program that parses the data as specified below :
data = """
1,Sweden,10
2,Finland,14
3,Denmark,4
4,Sweden,3
5,Sweden,90
6,Norway,45
7,Finland,2
"""
And outputs each country with how many times it appears in the data and the sum of the numbers to right of it, like this:
Sweden 3 103
Finland 2 16
Denmark 1 4
Norway 1 45
Your program should not hard code the countries, i.e. if a country is added later in data the program should still produce the correct output (with the new country).