Can anyone say how to sum up the item in dictionary in python. | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

Can anyone say how to sum up the item in dictionary in python.

24th May 2020, 3:47 PM
pooja balamurugan
pooja balamurugan - avatar
3 Antworten
+ 4
d = {1: 100, 2:200} print(sum(d.values())) >>> 300
24th May 2020, 4:30 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 1
Your question is quite unclear. Give us little more description. What thing you have to sum? No in keys , no in value what !
24th May 2020, 3:54 PM
Ayush Kumar
Ayush Kumar - avatar
+ 1
I have to sum up the numbers example: {'a':100, 'b':200, 'c':300} I have to sum these items in dictionary in python
24th May 2020, 3:57 PM
pooja balamurugan
pooja balamurugan - avatar