Jump to content

Averages/Mode: Difference between revisions

Line 1,246:
=={{header|Python}}==
The following solutions require that the elements be ''hashable''.
{{works with|Python|2.5,+ 2.6 &and 3.1x}}
<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):
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.