Advertisement
Jexal

5f78db56-a3dc-4343-8c54-adb4ef54be0a

Feb 14th, 2025
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. 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