摘要:
1:读取完一个大文件 with open('1.txt','r') as f: content=f.readline() while len(content)>0: print(content) content=f.readline() 2:读取完一个大文件中包含指定字符python的行 with 阅读全文
摘要:
1:已知字符串 str= 'skdaskerkjsalkj',请统计该字符串中各字母出现的次数 思路是:用字典 str='skdaskerkjsalkj'a=dict()for i in str: if i not in a.keys(): a[i]=1 else: a[i]=a[i]+1print 阅读全文