Question
Write a method in python to read the content from a text file diary.txt line by line and display the same on screen.
Solution
def read_file():
inFile = open('diary.txt', 'r')
for line in inFile:
print line