From e5032888185603c990fdf8023cc75adc69f0d974 Mon Sep 17 00:00:00 2001 From: Lukas Baumann Date: Wed, 17 Feb 2021 11:10:57 +0100 Subject: [PATCH] Create 3.py --- 15/b/3.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 15/b/3.py diff --git a/15/b/3.py b/15/b/3.py new file mode 100644 index 0000000..772cd45 --- /dev/null +++ b/15/b/3.py @@ -0,0 +1,16 @@ +txt = input().split() +while txt[-1] != "###": + txt += input().split() +amount = {} +for i in txt: + if i.lower() in amount: + amount[i.lower()] += 1 + else: + amount[i.lower()] = 1 +max = ["", 0] +for i in amount: + if amount[i] > max[1]: + max = [i, amount[i]] + else: + pass +print(max[0])