Sum of all items in a dictionary

Write a program to find sum of all items in a dictionary.

myDict = {'x': 250, 'y':500, 'z':410}

print("Dictionary: ", myDict)

total = 0

for i in myDict:

    total = total + myDict[i]

print("The Total Sum of Values : ", total)


 

 

OUTPUT 

Dictionary:  {'x': 250, 'y': 500, 'z': 410}

Sum of Values:  1160