readline in a file

Solutions on MaxInterview for readline in a file by the best coders in the world

showing results for - "readline in a file"
Arlene
14 Oct 2019
1myfile = open("demo.txt", "r")
2myline = myfile.readline()
3while myline:
4    print(myline)
5    myline = myfile.readline()
6myfile.close()   
7