i have seen many other questions but it all shows how to remove all \n characters.
def copy_lines(input, output, c):
with open("essay.txt","r") as f:
with open("out.txt","w") as s:
counter=0
for i in f:
counter+=1
if c==1:
data=i.strip()
s.write(data)
else:
data=i
s.write(data)
if counter==c:
break
i get output of this
'Write a title that summarizes the specific problem\n\nThe title is the first thing potential answerers will see.\n\n'
and i want it like this
'Write a title that summarizes the specific problem\n\nThe title is the first thing potential answerers will see.
so what i should modify?
i am picking up no of lines called c from a text file and writing it in another text file
so i dont want the last line to add \n when i check it with ''' '''