Definition:
A file method is a collection of tools that help to read, write, and manage files, keeping the content safe.
Some important tools of file methods in Python are:
read()
readline()
readlines()
write()
writelines()
close()
seek()
tell()
flush()
Example:
f = open("file1.txt","r")
data = f.read()
print(data)
f.close()
Output:
