Computer Science, asked by krithikthegreat1506, 11 months ago

Python program remove all the lines that contain the character a' in a file and write it to another file

Answers

Answered by gauravarduino
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