-
-
Save codecademydev/0fda438344ce453dda92c3bcd7bf08d9 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Write your sum_values function here: | |
def sum_values(my_dictionary): | |
sum = 0 | |
for values in my_dictionary.values(): | |
sum += values | |
return sum | |
# Uncomment these function calls to test your sum_values function: | |
print(sum_values({"milk":5, "eggs":2, "flour": 3, 'cat': 'animal'})) | |
# should print 10 | |
print(sum_values({10:1, 100:2, 1000:3})) | |
# should print 6 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment