Create 8 - a la Mode.py

This commit is contained in:
Lukas Baumann 2021-02-18 08:56:15 +01:00 committed by GitHub
parent faaeed147b
commit 5636537eda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

7
13/8 - a la Mode.py Normal file
View 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