print( read() close( )read text file:read(method is used for reading the content in the file #creating demo txt file gedit demo txt python is interesting programming language #write python program to read data in demo txt =open('demo txt',' 'print( read() close(#read only part of filef=open('demo txt',' 'print( read( )#returns first three characters close(#readlinesf=open('demo txt',' 'print( readline()#read only first line close(read all lines at timef=open('demo txt',' 'print( readlines() close( )write filethe write(method is used to write data to empty file or existing file it has two modes"wwrite opens file for writing data into empty file (or)overwriting the data in the existing file "aappend opens file for appending the data at end of the file syntaxfilepointer write('write the data which need to append or overwrite'exgedit empty txt creation of empty file #write program to write data into empty file =open('empty txt',' ' write(" am writing data into the empty text file" close(bv prasanthi,dept of cse page