limit : optional upper limit of bytes returned.
Output is a list of lines present inside the file.
Output is here ( used the data.txt file given at file read() )
['This is first line\n', 'This is second line\n', 'This is third line\n', 'This is fourth line']
We can use output as an iterator.
print(fob.readlines(10)) # ['This is first line\n']
Output is here
for x in my_data:
This is first line
This is second line
This is third line
This is fourth line
File Append File Write
Subscribe to our YouTube Channel here
This article is written by plus2net.com team.