#下载一首英文的歌词或文章strstr='''Baby, baby, baby nooo My baby, baby, baby noo My baby, baby, baby nooo I thought youd always be mine mine Baby, baby, baby nooo My baby, baby, baby noo My baby, baby, baby nooo'''print(str);#把单词全部变成小写print(str.lower());#分隔出一个一个的单词 listprint(str.split())#统计每个单词出现的次数print("统计每个单词出现的次数为:")strSet=set(str.split())for word in strSet: print(word,str.split().count(word))
练习歌词