zoukankan      html  css  js  c++  java
  • 下载一首英文的歌词或文章,统计单词出现的次数,将所有,.?!替换为空格,将所有大写转换为小写。

    '''
    下载一首英文的歌词或文章,统计单词出现的次数,将所有,.?!替换为空格,将所有大写转换为小写。
    '''
    sr='''You're ?insecure
    Don't know what for
    You're turning heads through the door
    Don't need make-up
    to cover up
    Being the way that you are is enough
    Everyone else in the room can see it
    Everyone else but you
    Baby you light up my world like nobody else
    The way that you flip your hair gets me overwhelmed
    But when you smile at the ground it ain't hard to tell
    You don't know Oh oh
    You don't know you're beautiful
    If only you saw what I can see
    You'll understand why I want you so desperately
    Right now I'm looking at you and I can't believe
    You don't know Oh !oh
    You don't know you're beautiful Oh oh
    That's what makes you beautiful
    So c-come on
    You got it wrong
    To prove I'm ,right '''
    
    print(sr.count('you'))
    for i in sr:
        sr=sr.replace(',','/t ')
        sr=sr.replace('!','/t ')
        sr=sr.replace('?','/t ')
    print(sr)
    for i in sr:
        sr=sr.upper()
    print(sr)
          

  • 相关阅读:
    继承—泛型
    单例模式
    继承 4—Monkey
    继承 3—A B E
    继承 2—people
    继承 1—Mucic
    面向对象—汽车
    面向对象—封装—汽车
    Linux下查看CPU型号,内存大小,硬盘空间的命令
    redis源码——数据结构与对象
  • 原文地址:https://www.cnblogs.com/garxiu/p/7542085.html
Copyright © 2011-2022 走看看