a
ar+
r+
w
write mode
read mode
append mode
Both (A) And (C)
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
None of the above
end
beginning
anywhere in between the file
Curly Braces
Round Brackets
Indentation
Semicolon
write()
append()
add()
insert()
remove((), file_name))
remove (new_file_name, current_file_name,)
remove (file_name)
All of the above
What will be the output of the following code?
f=open("demo.txt","r")print(f.tell())
1
2
-1
0
5 characters
5 words
5 lines
closed
softspace
rename
None of the above.
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
file_exists()
exists_file()
os.path.exists()
check_file()
f = open("data.txt", "a")
f = Open("data.txt", "ab")
f= new("data.txt", "a")
open("data.txt", "a")
what is 'f' in the following statement?
f=open("Data.txt","r")
file name
file handle
Mode of file
file handling
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.
What is the output?
f = open("test.txt", "w")f.write("Python")print(f.tell())f.close()
5
6
7
What will be the output?
f = open("test.txt", "w")f.write("Python")f.seek(0)print(f.read())
Python
Empty String
UnsupportedOperation Error
None
csv.reader(file)
csv.read(file)
csv.readcsv(file)
csv.readcsvdata(file)
ab
rw
w+
mode
a+
File size
Current file pointer position
Number of lines
Number of characters remaining
read()
readline()
readlines()
load()
_x=2
x=3
_xyz_=5
None of these
raise
goto
try
except
rb
rt
r
Comma Space Value
Comma Separated Value
Common spaced Value
Compact Structure View
Write
Read
Append
Read and Write Both
close_file()
file_close()
close()
end_file()
readlist()
readall()
+
b
seek()
tell()
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
f
t
f.seek(-10, 0)
f.seek(10,0)
f.seek(-10, 1)
raw_input
input
eval
accept
write
output
send
dump
End of File
End of Line
End of Statement
End of program
os.rename(existing_name, new_name)
fq.name = ‘new_name.txt’
os.rename(fp, new_name)
os.set_name(existing_name, new_name)
Read mode
Write mode
Append mode
Binary mode
File Found Error
File Not Exist Error
File Not Found Error
readcharacter()
readchar()
Both of the above
giga bytes
mega bytes
byte
bits
open_file()
file_open()
open()
read_file()
Data is appended
Error occurs
Old content is erased
Nothing happens
Brackets
Catch
Read two words from file
Read two line from file
Read two character / two bytes
count the number of '2' in file
Quick response code
Same format in which the data is held in memory
ASCII format
Unicode format