Advertisement
Guest User

yeet

a guest
Oct 21st, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. count_dict = {}
  2. for x in items:
  3. if x in count_dict:
  4. count_dict[x] += 1
  5. else:
  6. count_dict[x] = 1
  7. print (count_dict)
  8.  
  9. count_list = []
  10. for x in count_dict:
  11. count_list.append((x, count_dict[x]))
  12. count_list = sort_count_pairs(count_list)
  13. print (count_list)
  14.  
  15. count_list = count_list[:(len(count_list)-1) or None]
  16. return count_list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement