Guest User

Untitled

a guest
Nov 18th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. l= ['a', 'b', 'c']
  2. d = {'1': ['a', 'd', 'e'], '2': ['b', 'c', 'f'], '3': ['b', 'a', 'e']}
  3.  
  4. high = -1
  5. key = []
  6. for k,v in d.items():
  7. occ = (len(l) + len(v)) - len(set(l + v))
  8. print((set(l+v)))
  9. if(occ >= high):
  10. if(occ == high):
  11. key.append(k)
  12. else:
  13. key = [k]
  14. high = occ
  15. print(key)
Add Comment
Please, Sign In to add comment