f= open("f.txt",mode='r',encoding='utf8', newline=' ') # use enumerate to show that second line is read as a whole for i, line in enumerate(fd): print(i, line)