- read() is a python file function which are used to read the existing file.
-Here 'f' is the object which points the existing file.
- write() is a python file function which are used to write in the file.
- If the file is not exist then write() function create new file.
-Here string is the content which we want to insert into the file.
#opne file in write mode
f.write("Data insert into the file")
#open file in read mode
Data insert into the file
-In this program, initially we open the file named as 'myfile.txt' and 'txt' is shows that file is of type 'text',
-then by f.write("Data insert into the file") we write this string into the file.
-then by f.read() we get the all text of the file then we print that.