Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In this modification, I read all the lines from the input file at once using infile.readlines(), and then I check if the current line is the last line. If it is, I don't add the newline character at the end. This way, the extra newline character will be removed.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement