Write a python program to remove all the lines that contain the character `a' in a file and write it to another file.
Answers
Answered by
3
Explanation:
Answer:infile = file('./oldfile.txt')
newopen = open('./newfile.txt', 'w')
for line in infile :
if 'bad' in line:
line = line.replace('.' , '')
if 'naughty' in line:
line = line.replace('.', '')
else:
Answered by
3
Answer:
Answer:infile = file('./oldfile.txt')
newopen = open('./newfile.txt', 'w')
for line in infile :
if 'bad' in line:
line = line.replace('.' , '')
if 'naughty' in line:
line = line.replace('.', '')
else:
Read more on Brainly.in - https://brainly.in/question/13834299#readmore
Explanation:
Similar questions
English,
5 months ago
Social Sciences,
5 months ago
English,
5 months ago
English,
10 months ago
Accountancy,
10 months ago