Python program remove all the lines that contain the character a' in a file and write it to another file
Answers
Answered by
0
Explanation:
Write a Python program to remove newline characters from a file. Sample Solution: Python Code: def remove_newlines(fname): flist = open(fname).readlines() return [s.rstrip('\n') for s in flist] print(remove_newlines("test.txt")) Flowchart: Python Code Editor: Have another way to solve this solution?
Similar questions
Chemistry,
6 months ago
English,
6 months ago
Math,
6 months ago
Computer Science,
11 months ago
Biology,
11 months ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago