Guest User

Untitled

a guest
Oct 23rd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. some_dict = {64630: 1, 11735: 1, 14216: 1, 99233: 1, 14470: 1, 4978: 2, 73429: 1, 38120: 1, 51135: 1, 67060: 1}
  2.  
  3. for key,value in mode_dict.items():
  4. if value == max(mode_dict.values()):
  5. return key
  6.  
  7. d = {1: 1, 2: 2, 3: 2, 4: 4}
  8. dd = list(d.values())
  9.  
  10. res = max([(dd.count(s), s) for s in set(dd)], key=lambda x: x[0])
  11. if res[0] > 1:
  12. print(res[1])
  13. else:
  14. print(min(dd))
Add Comment
Please, Sign In to add comment