摘要:
1.读入待分析的字符串 fo=open('tt.txt','r')#以阅读方式打开文档tt.txt news=fo.read() 2.分解提取单词 news=news.lower() for i in ',.-"': news=news.replace(i,' ') words=news.split 阅读全文
摘要:
1、实例: 下载一首英文的歌词或文章,将所有,.?!等替换为空格,将所有大写转换为小写,统计某几个单词出现的次数,分隔出一个一个的单词。/ abc='''Models from different countries took to the catwalk in qipao, a tradition 阅读全文
摘要:
1、简单输入输出交互。 name=input('what is your name?\n') what is your name? mon print('Hi,%s.'%name) Hi,mon. 2、用户输入两个数字,计算并输出两个数字之和: m=input('input:') 尝试只用一行代码实 阅读全文