Q. Write a single loop to display all the contents of a text file poem.txt after removing leading and trailing white-spaces.
Answer :-
for line in file ("poem.txt"):
print (line.strip())
Answer :-
for line in file ("poem.txt"):
print (line.strip())
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )