第三次

love='''There was once a broken man,
who walked a lonely road,
and gave up all his dream, 
i was once this broken man, 
who standing into the sun,
and just refused to see,
i was lost among the clouds that wouldn't fade,
i was looking for an answer,
i was searching but i didn't take the time,
i was down and out and feeling so afraid,
i love you,
the way that you turned me round,
and chased away my blues,
i love you,
the way that you changed my world,
when i'm with you,
love may come and love may go,
but now it's here to stay,
forever and a day with you,
and when i see you smile,
i fall into your eyes,
don't ever fade away,
i needs you here to make the dark clouds drift away,
and to make the mornings bright again,
i'm right here for you,
and there's nothing more to say,
i am just happy that you're mine you've stayed,
i love you,
the way that you turned me round,
and chased away my blues,
i love you,
yes i do,
the way that you changed my world,
when i'm with you,
it doesn't matter where we're far,
and where we're going,
as long as you're with me all the way,
and the nights are no longer lonely,
and wake up now to find a brighter day,
i love you,
yes i do,
the way that you turned me round,
and chased away my blues,
i love you,
yes i do,
the way that you changed my word,
when i'm with you.'''
c=''',,.'''
for qq in c:
    love=love.replace(qq,' ').lower()
ll=love.split()

jihe=set(ll)
print(jihe)
for aa in jihe:
    print(aa,ll.count(aa))

  

 

列表:可以修改,[],有序的

元组:不可修改,(),其中的元素类型不可以不相同,有序的

字典:不可修改,{},键:值,无序,字典是一种映射类型,它的元素是键值对,字典键的类型不 可   变。

集合:可以修改,{}/set(),创建一个空集合必须用 set(),并且是无序的。里面没有重复值。

 

 

 

 

   

posted @ 2018-10-11 11:26  梁柏钧  阅读(152)  评论(0编辑  收藏  举报