code for showing contents of a file and printing it in python

Solutions on MaxInterview for code for showing contents of a file and printing it in python by the best coders in the world

showing results for - "code for showing contents of a file and printing it in python"
Maximilian
15 Sep 2018
1import os
2
3with open("filename", "r+") as file:
4    content = file.readline()
5    while(content!=""):
6      	print(content)
7        content = file.readline()
8    file.close
9