From 5636537eda756f42e98e51797c6b35e39d429e94 Mon Sep 17 00:00:00 2001 From: Lukas Baumann Date: Thu, 18 Feb 2021 08:56:15 +0100 Subject: [PATCH] Create 8 - a la Mode.py --- 13/8 - a la Mode.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 13/8 - a la Mode.py diff --git a/13/8 - a la Mode.py b/13/8 - a la Mode.py new file mode 100644 index 0000000..bf637a9 --- /dev/null +++ b/13/8 - a la Mode.py @@ -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