fhandle = open("alice.txt", "r") lineno = 1 for line in fhandle: print("%4d." % lineno, line, end="") lineno = lineno + 1 fhandle.close()