- writelines() is a python file function which are used to insert a data into the file in muliple lines.
#write data into file in multiple lines
f.writelines("first linensecond linenthird linenfourth linenfifth line")
#read the file
-In this program, we insert the data by writelines()
function and string are pass that contain line break(n) so writelines()
function insert according to the 'n' into multiple lines, and by using read() function we read the file.