with open(filename, "r") as fs: for line in fs: pass
Each line might be terminated with a \n to indicate that there is another line after itself.
line
\n
A line that terminates at EOF will not have a \n.
line = line.rstrip("\n")