f = open("data.txt", "a")
f = Open("data.txt", "ab")
f= new("data.txt", "a")
open("data.txt", "a")
open_file()
file_open()
open()
read_file()
Read two words from file
Read two line from file
Read two character / two bytes
count the number of '2' in file
read()
readline()
readlines()
load()
Which of the following error is returned by the given code ?
f = open("test.txt","w")f.write(345)
Syntax Error
Type Error
String Error
Run Time Error
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
Comma Space Value
Comma Separated Value
Common spaced Value
Compact Structure View
End of List
End of Line
End of Loop
End of Language
f.seek(-10, 0)
f.seek(10,0)
f.seek(-10, 1)
None of the above
closed
softspace
rename
None of the above.
mode
Dictionary
String
Tuple
List
End of File
End of Statement
End of program
It is used for object serialization
It is used for object deserialization
All of the mentioned
None of the mentioned
r
w
+
b
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)
_x=2
x=3
_xyz_=5
ab
rw
a+
r+
f.read(5)
f.read()=5
f.readline(5)
f.readlines(5)
f.readlines()
f.readline()
f.read()
f.line()
close_file()
file_close()
close()
end_file()
Tells you the current position within the file.
Tells the size of file you read
Tells the start position of the file.
Tells the end position of the file.
try
Brackets
Indentation
Catch
Both of the above
giga bytes
mega bytes
byte
bits
write
output
send
dump
Write
Read
Append
Read and Write Both
os.rename(existing_name, new_name)
fq.name = ‘new_name.txt’
os.rename(fp, new_name)
os.set_name(existing_name, new_name)
w+
a
ar+
Use multiple write() statements.
Use writelines() method.
Use writeLine() method.
Use append() method.
f
t
raw_input
input
eval
accept
File Found Error
File Not Exist Error
File Not Found Error
5 characters
5 words
5 lines
read binary
write binary
append binary
read write
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
It is used for object de-serialization
change the string value to number
extract the list element in simple variable
Quick response code
Same format in which the data is held in memory
ASCII format
Unicode format
rb
remove((), file_name))
remove (new_file_name, current_file_name,)
remove (file_name)
All of the above
f.reads()
f.read(all)
f.read( *)
end
beginning
anywhere in between the file
file_exists()
exists_file()
os.path.exists()
check_file()
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
write()
append()
add()
insert()
readall()
readcharacter()
readchar()
f = open('data.txt'); f.read()
f = open('data.txt','r'); f.read(n)
myfile = open('data.txt'); f.readline()
f= open('data.txt'); f.readlines()
csv.reader(file)
csv.read(file)
csv.readcsv(file)
csv.readcsvdata(file)