csc-python-solutions/13/8 - a la Mode.py
2021-02-18 08:56:15 +01:00

8 lines
161 B
Python

def mode(L):
frequency = [0]*10
for i in L:
frequency[i] = frequency[i] + 1
for i in range(0, 10):
if frequency[i]==max(frequency):
return i