DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
python get majority of list
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:
#python
#majority
#list
ADD COMMENT
Topic
COMMENT
Name
2+5 =
Submit