Update 3 - Poetic Analysis.py
This commit is contained in:
parent
80e1239159
commit
665b8f3835
@ -1,14 +1,7 @@
|
|||||||
txt = input().split()
|
txt = input().lower().split()
|
||||||
while txt[-1] != "###":
|
while txt[-1] != "###":
|
||||||
txt += input().split()
|
txt += input().lower().split()
|
||||||
amount = {}
|
m = [0]*len(txt)
|
||||||
for i in txt:
|
for i in range(len(txt)):
|
||||||
if i.lower() in amount:
|
m[i]=txt.count(txt[i])
|
||||||
amount[i.lower()] += 1
|
print(txt[m.index(max(m))])
|
||||||
else:
|
|
||||||
amount[i.lower()] = 1
|
|
||||||
max = ["", 0]
|
|
||||||
for i in amount:
|
|
||||||
if amount[i] > max[1]:
|
|
||||||
max = [i, amount[i]]
|
|
||||||
print(max[0])
|
|
||||||
|
Loading…
Reference in New Issue
Block a user