names = input()
t = names.split()
d = {}
for c in range(len(t)):
d[t[c]] = d.get(t[c],0) + 1
ls = list(d.items())
print("第一个ls:", ls)
ls.sort(key=lambda x:x[1], reverse=True) # 按照数量排序
print("第二个ls:",ls)
for k in range(len(ls)):
zy,num = ls[k]
print(zy,"和",num)
print("{}:{}".format(zy,num))
PS:The command of “.sort” can only be used on LIST!(Just from my perspective…)