fork download
  1. from random import random
  2.  
  3. a = [int(random()*5) for i in range(15)]
  4. print(a)
  5.  
  6. a_set = set(a)
  7.  
  8. most_common = None
  9. qty_most_common = 0
  10.  
  11. for item in a_set:
  12. qty = a.count(item)
  13. if qty > qty_most_common:
  14. qty_most_common = qty
  15.  
  16.  
  17. print(item)
Success #stdin #stdout 0.04s 11672KB
stdin
Standard input is empty
stdout
[3, 2, 2, 1, 2, 0, 2, 0, 1, 0, 3, 3, 2, 4, 0]
4