résumer toutes les valeurs d'un dictionnaire Python
sum(dictionary.values())
Smoggy Serval
sum(dictionary.values())
example_list = [
{'points': 400, 'gold': 2480},
{'points': 100, 'gold': 610},
{'points': 100, 'gold': 620},
{'points': 100, 'gold': 620}
]
sum(item['gold'] for item in example_list)