Anonymous user
Averages/Mode: Difference between revisions
→{{header|Python}}
Line 1,246:
=={{header|Python}}==
The following solutions require that the elements be ''hashable''.
{{works with|Python|2.5
<lang python>>>> from collections import defaultdict
>>> def modes(values):
Line 1,260:
[1, 4]</lang>
{{works with|Python|2.7+ and 3.1+}}
<lang python>>>> from collections import Counter
>>> def modes(values):
|