2020年4月1日

练习,循环读取txt文档中a的所在行号

摘要: with open('a.txt','a+') as f: f.seek(0) fr = f.readlines() for i in fr: if i.count('a'): print(fr.index(i)+1) 阅读全文

posted @ 2020-04-01 11:18 奥喵 阅读(212) 评论(0) 推荐(0) 编辑

导航