# Write a function that takes # (i) a dictionary whose values are lists of ints, and # (ii) a secret int code # as inputs. # The function returns the number of values whose # sums equal to the secret int code. # If no sum of the values in the dictionary equals to # the secret int code, return None # Example: # if the incoming dictionary is {'A':[0,1], 'B':[2,3], 'C':[4,5], 'D':[1,4]} # and the secret int code is 5 # the function returns 2 # if the incoming dictionary is {'A':[0,1], 'B':[2,3], 'C':[4,5], 'D':[1,4]} # and the secret int code is 15 # the function returns None # You may not use sum(list_of_int) built-in function def count_sum(d, secret): count = 0 for k, v in dct.items(): sum_v = 0 for item in v: sum_v += item if sum_v == secret: count += 1 if count > 0: return count return None dct = {'A': [0, 1], 'B': [2, 3], 'C': [4, 5], 'D': [1, 4]} print(count_sum(dct, 5)) print(count_sum(dct, 15))