Answers for "Python | Find most frequent element in a list"

0

Python | Find most frequent element in a list

# Program to find most frequent 
# element in a list
def most_frequent(List):
    return max(set(List), key = List.count)
  
List = [2, 1, 2, 2, 1, 3]
print(most_frequent(List))
Posted by: Guest on July-11-2021

Code answers related to "Python | Find most frequent element in a list"

Python Answers by Framework

Browse Popular Code Answers by Language