Cse Material5
Cse Material5
This file
object has various attributes and methods that you can use to interact with the file. Here are
some common attributes of a file object:'''
example1.txt
In [2]: #mode: indicates the mode in which the file was opened
#(e.g., 'r' for read, 'w' for write, 'a' for append).
file=open('example1.txt')
print(file.mode)
file.close()
Original Content:
Modified Content:
This is
This is
File Descriptor: 3
In [ ]: