10月8作业
运行代码:
geci='''I can't figure out Is it meant to be this way Easy words so hard to say I can't live without Knowing how you feel Know if this is real Tell me am I mistaken Cause I don't have another heart for breaking Please don't let me go I just wanna stay Can't you feel my heartbeats Giving me away I just wanna know If you too feel afraid I can feel your heartbeats Giving you away Giving us away ''' zyl=geci.lower() zyl=zyl.replace(",","") print(zyl) asd=zyl.count('heartbeats') print(asd) yl=zyl.split() print(yl) dic={} for i in set(yl): dic[i]=yl.count(i) print(dic)
运行结果: