import operator
text = '''
Youth means a temperamental predominance of courage over timidity, of the appetite for adventure over the love of ease. This often exits in a man of 60, more than a boy of 20.nobody grows merely by the number of years; we grow old by deserting our ideas. Years may wrinkle the skin, but to give up enthusiasm wrinkles the soul. Worry, fear, self-distrust1 bows the heart and turns the spirit back to dust
'''
# 先转换为小写
lo_text = txt.lower().split()
# 利用字典进行处理
dic = {}
for word in lo_text:
if word not in dic:
dic[word] = 1
else:
dic[word] = dic[word] + 1
#排序
swd = sorted(dic.items(),key = operator.itemgetter(1),reverse=True)
print(swd)