DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
7+3 =
Submit