- readline() is a python function used in file handling which read the line of the file one by one.
Syntax-
f=open('myfile.txt','r')
f.readline()
program-
#write data in file in multiple lines
f=open("myfile.txt",'w')
f.write("firstnsecondnthirdnfourthnfive")
f.close()
#read file line by line
f=open("myfile.txt",'r')
print(f.readline())
print(f.readline())
print(f.readline())
print(f.readline())
print(f.readline())
f.close()
first
second
third
fourth
five