How to find the most common list item in Python?
Most common list item
thelist = [1, 4, 2, 3, 5, 4, 5, 6, 7, 8, 1, 3, 4, 5, 9, 10, 11] most_common = max(thelist, key=thelist.count) print(most_common)
4
thelist = [1, 4, 2, 3, 5, 4, 5, 6, 7, 8, 1, 3, 4, 5, 9, 10, 11] most_common = max(thelist, key=thelist.count) print(most_common)
4