#Remove all the lines that contain the character 'a' in a file and
#write it to another file
f=open("ram.txt")
f1=open("sita.txt","w")
f2=open("durga.txt","w")
data=f.readlines()
for i in data:
if 'a' in i:
f1.writelines(i)
else:
f2.writelines(i)
f1.close()
f2.close()
f.close()
No comments:
Post a Comment
for more information please share like comment and subscribe