Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. dictionary_a= [{'A':3,'B':4,'C':9,'D':10},{'A':8,'B':8,'C':10,'D':4,'E':5}]
  2. dictionary_b={'A':0,'N':1,'B':6,'C':8,'B':10,'E':5}
  3. ret = []
  4. for dict in dictionary_a:
  5. sum = 0
  6. for k in dict.keys():
  7. sum += dict[k]*dictionary_b.get(k, 0)
  8. ret.append(sum)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement