Open this example in the interactive library
Source code
from statistics import multimode
print(multimode([1, 1, 2, 2, 3]))Sample output
[1, 2]

Find multiple modes. A self-contained example using the Python standard library.
Open this example in the interactive library
from statistics import multimode
print(multimode([1, 1, 2, 2, 3]))[1, 2]