infile.read(2)
infile.read()
infile.readlines()
infile.readline()
dump()
load()
Both A and B
None of the above
Append File
Write File
Read File
Read and Write both
pickle
binary
unpickle
fstream
write()
writeBinary()
read binary
write binary
append binary
read write
File Found Error
File Not Exist Error
File Not Found Error
None of these
a
ar+
r+
w
ab
rw
a+
readlines()
read()
Both of the above
What will be the output of the following code?
f=open("demo.txt","r") print(f.tell())
1
2
-1
0
os.rename(existing_name, new_name)
fq.name = ‘new_name.txt’
os.rename(fp, new_name)
os.set_name(existing_name, new_name)
write
output
send
dump
reference_point indicates the current position of the file object
reference_point indicates the starting position of the file object
reference_point indicates the ending position of the file object
What will be the output of the following code ?
f=open("demo.txt","w+") f.write("Welcome to python") f.seek(5) a=f.read(5) print(a)
Welco
me to
Welcome to Python
e to
readall()
readcharacter()
readchar()
softspace
mode
closed
rename
Dictionary
String
Tuple
List
_x=2
x=3
_xyz_=5