Advertisement
askanton

monstro

Jun 5th, 2020
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. my_dict = {'a': 2, 'b': 1, 'c': 3, 'd': 1, 'e': 2}
  2. list = ['a', 'b', 'c', 'd', 'e']
  3. i = 0
  4. x = -1
  5. for item in my_dict:
  6.     countr = 0
  7.     y = 0
  8.     x = x +1
  9.     for items in my_dict:
  10.         if my_dict.get(list[x]) == my_dict[list[y]]:
  11.             countr = countr +1
  12.         y = y + 1
  13.     print("count " + str(list[x]) + " =" + str(countr))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement