python find most occuring element

from collections import Counter

a = [1936, 2401, 2916, 4761, 9216, 9216, 9604, 9801] 

c = Counter(a)

print(c.most_common(1)) # the one most common element... 2 would mean the 2 most common
[(9216, 2)] # a set containing the element, and it's count in 'a'

Here is what the above code is Doing:
1. It’s creating a list of integers called ‘a’.
2. It’s creating a Counter object called ‘c’ that counts the number of times each element appears in ‘a’.
3. It’s printing the most common element in ‘a’.

The output of the code is [(9216, 2)]. This means that 9216 appears twice in ‘a’.

If you want to know the second most common element in ‘a’, you can use the following code:

c = Counter(a)

print(c.most_common(2))

The output of the code is [(9216, 2), (9801, 1)]. This means that 9216 appears twice in ‘a’ and 9801 appears once in ‘a’.