softspace
mode
closed
rename
open_file()
file_open()
open()
read_file()
giga bytes
mega bytes
byte
bits
readlines()
read()
Both of the above
None of the above
a
f
w
t
Dictionary
String
Tuple
List
f.reads()
f.read()
f.read(all)
f.read( *)
ar+
r+
raise
goto
try
except
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()
what is 'f' in the following statement?
f=open("Data.txt","r")
file name
file handle
Mode of file
file handling
r
+
b
It is used for object serialization
It is used for object deserialization
All of the mentioned
None of the mentioned
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
ab
rw
a+
Brackets
Indentation
Catch
csv.reader(file)
csv.read(file)
csv.readcsv(file)
csv.readcsvdata(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.
write()
append()
add()
insert()
f.seek(-10, 0)
f.seek(10,0)
f.seek(-10, 1)
What will be the output of the following code?
f=open("demo.txt","r")print(f.tell())
1
2
-1
0
readline()
load()
f = open("data.txt", "a")
f = Open("data.txt", "ab")
f= new("data.txt", "a")
open("data.txt", "a")
Write
Read
Append
Read and Write Both
f.readlines()
f.readline()
f.line()
f.read(5)
f.read()=5
f.readline(5)
f.readlines(5)
It is used for object de-serialization
change the string value to number
extract the list element in simple variable
5 characters
5 words
5 lines
Use multiple write() statements.
Use writelines() method.
Use writeLine() method.
Use append() method.
file_exists()
exists_file()
os.path.exists()
check_file()
_x=2
x=3
_xyz_=5
None of these
read binary
write binary
append binary
read write
end
beginning
anywhere in between the file
End of File
End of Line
End of Statement
End of program
Read two words from file
Read two line from file
Read two character / two bytes
count the number of '2' in file
raw_input
input
eval
accept
End of List
End of Loop
End of Language
None of the above.
w+
close_file()
file_close()
close()
end_file()
os.rename(existing_name, new_name)
fq.name = ‘new_name.txt’
os.rename(fp, new_name)
os.set_name(existing_name, new_name)
File Found Error
File Not Exist Error
File Not Found Error
rb
Quick response code
Same format in which the data is held in memory
ASCII format
Unicode format
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
Comma Space Value
Comma Separated Value
Common spaced Value
Compact Structure View
Curly Braces
Round Brackets
Semicolon
readall()
readcharacter()
readchar()
Read mode
Write mode
Append mode
Binary mode