Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

majority in array python

l = [1,2,3,4,3,3,2,4,5,6,1,2,3,4,5,1,2,3,4,6,5]
print(max(set(l), key = l.count)) # 3
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #majority #array #python
ADD COMMENT
Topic
Name
7+3 =