Advertisement
ancestor_tunji

# sum_of_values

Mar 8th, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. # sum_of_values
  2. my_dict = {"a": 5, "b" : 3, "c" : 10}
  3. list_of_strings = ["a"]
  4. def sum_of_values(my_dict, list_of_strings):
  5. for val in sum_of_values:
  6. for key, value in my_dict.items():
  7. if my_dict.keys() == list_of_strings:
  8. return sum(value)
  9. sum_of_values(my_dict, list_of_strings)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement