r
rb
w
r+
file_object=open(file_name,mode)
open(file_object,file_name,mode)
file_open(file_object,file_name,mode)
file_object=file_open(file_name,mode)
ab
rw
w+
giga bytes
mega bytes
byte
bits
It is used for object serialization
It is used for object de-serialization
change the string value to number
extract the list element in simple variable
sets the file's current position at the offset
sets the file's previous position at the offset
sets the file's current position within the file
None of these
Write
Read
Append
Read and Write Both
raise
goto
try
except
seek()
read()
close()
tell()
move()
shift()
rt
Data is appended
Error occurs
Old content is erased
Nothing happens
random
sys
math
os
End Of Folder
Exit Open File
End Of File
Error On File
readlines()
readline()
readlist()
readall()
What happens if the file does not exist?
f = open("abc.txt", "r")
New file is created
FileNotFoundError
Returns None
Opens empty file
What will be written to the file?
f = open("test.txt", "w") f.write("ABC") f.write("DEF") f.close()
ABC
DEF
ABCDEF
Error
What is the output?
f = open("test.txt", "w") f.write("Python") print(f.tell()) f.close()
5
6
7
0
File size
Current file pointer position
Number of lines
Number of characters remaining
a