求大神教教!!谢谢谢谢

 

s = input("请输入英文文章:")
s = s.lower()
s = s.split(" ")
s = [i.strip(',').strip('.') for i in s]
total = {}
for i in s:
    if total.get(i,0):
        total[i] += 1
    else:
        total[i] = 1
print("单词统计结果如下:")
for key,value in total.items():
    print("{} : {}".format(key,value))
s_t = dict(sorted(total.items(),key=lambda x:x[1],reverse=True))
max_total = max(s_t.values())
print("出现频率最高的单词有:")
for key,value in s_t.items():
    if value == max_total:
        print(key)
    if value < max_total:
        break
print("共出现了{}次".format(max_total))