DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
find the item with the maximum number of occurrences in a list in Python
l=[1,2,3,4,2,1,3,4,2,1,3,4,2] l1 = max(l,key=l.count) print(l1)
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#find
#item
#maximum
#number
#occurrences
#list
#Python
ADD COMMENT
Topic
COMMENT
Name
5+8 =
Submit