Create 8 - a la Mode.py
This commit is contained in:
parent
faaeed147b
commit
5636537eda
7
13/8 - a la Mode.py
Normal file
7
13/8 - a la Mode.py
Normal file
@ -0,0 +1,7 @@
|
||||
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
|
Loading…
Reference in New Issue
Block a user