Python program to remove newline characters from a file
with open('file1.txt','r+') as f:
line = f.readlines()
print(line)
[print(l.strip()) for l in line]
Are there any code examples left?
New code examples in category Python
with open('file1.txt','r+') as f:
line = f.readlines()
print(line)
[print(l.strip()) for l in line]