Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # sum_of_values
- my_dict = {"a": 5, "b" : 3, "c" : 10}
- list_of_strings = ["a"]
- def sum_of_values(my_dict, list_of_strings):
- for val in sum_of_values:
- for key, value in my_dict.items():
- if my_dict.keys() == list_of_strings:
- return sum(value)
- sum_of_values(my_dict, list_of_strings)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement