练习,循环读取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)
小白白又白
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)