Read a file line by line in Python

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.

A line that terminates at EOF will not have a \n.

Remove the new-line character

line = line.rstrip("\n")