Create 3.py

This commit is contained in:
Lukas Baumann 2021-02-17 11:10:57 +01:00 committed by GitHub
parent 9e611363ce
commit e503288818
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

16
15/b/3.py Normal file
View File

@ -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])