Read file line by line in Python

f = open("data.txt")
for line in f:
  print(line.strip())
f.close()