_x=2
x=3
_xyz_=5
None of these
What happens if the file does not exist?
f = open("abc.txt", "r")
New file is created
FileNotFoundError
Returns None
Opens empty file
Data is appended
Error occurs
Old content is erased
Nothing happens
write()
append()
add()
insert()
End Of Folder
Exit Open File
End Of File
Error On File
f = open("data.txt", "a")
f = Open("data.txt", "ab")
f= new("data.txt", "a")
open("data.txt", "a")
Comma Space Value
Comma Separated Value
Common spaced Value
Compact Structure View
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
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
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.
f.reads()
f.read()
f.read(all)
f.read( *)
Read mode
Write mode
Append mode
Binary mode
os.rename(existing_name, new_name)
fq.name = ‘new_name.txt’
os.rename(fp, new_name)
os.set_name(existing_name, new_name)
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
f.seek(-10, 0)
f.seek(10,0)
f.seek(-10, 1)
None of the above
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
open_file()
file_open()
open()
read_file()
giga bytes
mega bytes
byte
bits
ab
rw
a+
r+
r
rb
w
csv.reader(file)
csv.read(file)
csv.readcsv(file)
csv.readcsvdata(file)
What is the output?
f = open("test.txt", "w")f.write("Python")print(f.tell())f.close()
5
6
7
0
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
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)
readlines()
readline()
readlist()
readall()
a
Dictionary
String
Tuple
List
ar+
softspace
mode
closed
rename
raise
goto
try
except
Write
Read
Append
Read and Write Both
end
beginning
anywhere in between the file
rt
None of the above.
What will be written to the file?
f = open("test.txt", "w")f.write("ABC")f.write("DEF")f.close()
ABC
DEF
ABCDEF
Error
f.read(5)
f.read()=5
f.readline(5)
f.readlines(5)
read()
load()
write
output
send
dump
5 characters
5 words
5 lines
Read two words from file
Read two line from file
Read two character / two bytes
count the number of '2' in file
w+
File size
Current file pointer position
Number of lines
Number of characters remaining
f.readlines()
f.readline()
f.line()
readcharacter()
readchar()
read binary
write binary
append binary
read write
what is 'f' in the following statement?
f=open("Data.txt","r")
file name
file handle
Mode of file
file handling
Use multiple write() statements.
Use writelines() method.
Use writeLine() method.
Use append() method.
Quick response code
Same format in which the data is held in memory
ASCII format
Unicode format
It is used for object deserialization
All of the mentioned
None of the mentioned
End of File
End of Line
End of Statement
End of program