Write a python program to sum all the items in a given dictionary. on April 25, 2025 Get link Facebook X Pinterest Email Other Apps # Sample dictionary with numeric valuesmy_dict = { "a": 10, "b": 20, "c": 30}# Sum of all valuestotal = sum(my_dict.values())# Print the resultprint("Sum of all items in the dictionary:", total)Output: Comments
Comments
Post a Comment