With the help of ...................method you can find the name of the current working directory.
A)
getcwd()
done
clear
B)
getdir()
done
clear
C)
dir()
done
clear
D)
gelcur()
done
clear
View Answer play_arrow
By using ................method, you can rename the file or folder.
A)
flush()
done
clear
B)
filename()
done
clear
C)
rename()
done
clear
D)
fname()
done
clear
View Answer play_arrow
To remove/delete a file, ........................ method can be used.
A)
filename()
done
clear
B)
rename()
done
clear
C)
remove()
done
clear
D)
flush()
done
clear
View Answer play_arrow
A ........................ file cannot be read by human directly, to read this type of file you have to create a reading program.
A)
text
done
clear
B)
binary
done
clear
C)
special
done
clear
D)
None of the above
done
clear
View Answer play_arrow
The ..................... statement automatically closes the file after the processing on the file gets over.
A)
try
done
clear
B)
except
done
clear
C)
catch
done
clear
D)
with
done
clear
View Answer play_arrow
The readline() returns a fist of line from the file till..........
A)
end of file
done
clear
B)
end of word
done
clear
C)
end of line
done
clear
D)
end of characters
done
clear
View Answer play_arrow
'n' characters from the file can be read by .................. method.
A)
readline(n)
done
clear
B)
reads(n)
done
clear
C)
read(n)
done
clear
D)
readlines(n)
done
clear
View Answer play_arrow
If you want transfer data from buffer to file forcefully, then..................... function is used.
A)
flush()
done
clear
B)
with
done
clear
C)
read()
done
clear
D)
write()
done
clear
View Answer play_arrow
To read 4 characters from a file object "myfile", which statement you should use:
A)
myfile.read(4)
done
clear
B)
myfile.read()
done
clear
C)
myfile.readline()
done
clear
D)
myfile.readlines()
done
clear
View Answer play_arrow
To read the complete content of a file as a string from a file object f, which statement you should use:
A)
f.read(5)
done
clear
B)
f.read()
done
clear
C)
f.readline()
done
clear
D)
f.readlines()
done
clear
View Answer play_arrow
A file object is also known as...........
A)
file recover
done
clear
B)
file cursor
done
clear
C)
file content
done
clear
D)
file handle
done
clear
View Answer play_arrow
When you open a file in this mode, the file pointer is placed at the beginning of the file and if the file is not existing, it will generate FileNotFoundError.
A)
r+
done
clear
B)
rb
done
clear
C)
w
done
clear
D)
r
done
clear
View Answer play_arrow
It opens a binary file for reading only. File must exist.
A)
r+
done
clear
B)
rb
done
clear
C)
w
done
clear
D)
r
done
clear
View Answer play_arrow
It opens a file for both reading and writing mode.
A)
r+
done
clear
B)
rb
done
clear
C)
w
done
clear
D)
r
done
clear
View Answer play_arrow
The read() function reads data from the ................. of a file.
A)
at the end
done
clear
B)
from current position
done
clear
C)
from cursor position
done
clear
D)
beginning
done
clear
View Answer play_arrow
The pickle module contains two main methods called ................... and ................. for writing and reading operation.
A)
flush() and get()
done
clear
B)
dump() and load()
done
clear
C)
read() and write()
done
clear
D)
open() and close()
done
clear
View Answer play_arrow
To open a file e:\study.txt for reading, which statement you should use:
A)
done
clear
B)
done
clear
C)
done
clear
D)
done
clear
View Answer play_arrow
To open a file d:\test.txt for writing, which statement you should use:
A)
done
clear
B)
done
clear
C)
done
clear
D)
done
clear
View Answer play_arrow
To open a file c:\test.txt for appending data, which statement you should use:
A)
done
clear
B)
done
clear
C)
done
clear
D)
done
clear
View Answer play_arrow
How many parameters you can pass in open() method:
A)
1
done
clear
B)
2
done
clear
C)
3
done
clear
D)
4
done
clear
View Answer play_arrow
How many parameters you can pass in read() method:
A)
1
done
clear
B)
2
done
clear
C)
3
done
clear
D)
4
done
clear
View Answer play_arrow
A ................function is also built in function which breaks the link of file-object and the file on the disk
A)
flush()
done
clear
B)
close()
done
clear
C)
load()
done
clear
D)
none of the above
done
clear
View Answer play_arrow
What is the output of the following code:
A)
Hello!Study Trigger
done
clear
B)
Hello!\nStudy Trigger
done
clear
C)
Generate Error
done
clear
D)
None of the above
done
clear
View Answer play_arrow
What is the output of the following code:
A)
Hello!HiHow
done
clear
B)
[Hello!HiHow]
done
clear
C)
Generate Error
done
clear
D)
None of the above
done
clear
View Answer play_arrow
Serialisation is also called........................
A)
Unpickling
done
clear
B)
Pickling
done
clear
C)
both a and b
done
clear
D)
none of the above
done
clear
View Answer play_arrow
.........................is the process in which an object converts into a byte stream
A)
Unpickling
done
clear
B)
Pickling
done
clear
C)
both a and b
done
clear
D)
none of the above
done
clear
View Answer play_arrow
.........................is the process in which a byte stream converts into object.
A)
Unpickling
done
clear
B)
Pickling
done
clear
C)
both a and b
done
clear
D)
none of the above
done
clear
View Answer play_arrow
Writing data Into Binary file is also called Unpickling
A)
True
done
clear
B)
False
done
clear
C)
None of these
done
clear
D)
All of the above
done
clear
View Answer play_arrow