Read mode
Write mode
Append mode
Binary mode
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()
Read two words from file
Read two line from file
Read two character / two bytes
count the number of '2' in file
a
f
w
t
f.read(5)
f.read()=5
f.readline(5)
f.readlines(5)
ar+
r+
read()
readline()
readlines()
load()
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)
Write
Read
Append
Read and Write Both
raw_input
input
eval
accept
f = open("data.txt", "a")
f = Open("data.txt", "ab")
f= new("data.txt", "a")
open("data.txt", "a")
close_file()
file_close()
close()
end_file()
File Found Error
File Not Exist Error
File Not Found Error
None of these
Dictionary
String
Tuple
List
Quick response code
Same format in which the data is held in memory
ASCII format
Unicode format
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
giga bytes
mega bytes
byte
bits
End of List
End of Line
End of Loop
End of Language
_x=2
x=3
_xyz_=5
Curly Braces
Round Brackets
Indentation
Semicolon
ab
rw
w+
a+
try
Brackets
Catch
raise
goto
except
Both of the above
None of the above
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
closed
softspace
rename
None of the above.
open_file()
file_open()
open()
read_file()
remove((), file_name))
remove (new_file_name, current_file_name,)
remove (file_name)
All of the above
os.rename(existing_name, new_name)
fq.name = ‘new_name.txt’
os.rename(fp, new_name)
os.set_name(existing_name, new_name)
write mode
read mode
append mode
Both (A) And (B)
Use multiple write() statements.
Use writelines() method.
Use writeLine() method.
Use append() method.
f.readlines()
f.readline()
f.read()
f.line()
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()
file_exists()
exists_file()
os.path.exists()
check_file()
readall()
readcharacter()
readchar()
mode
End of File
End of Statement
End of program
end
beginning
anywhere in between the file