WorksheetsFILE HANDLING IN PYTHON
Total questions: 10
Worksheet time: 8mins
(a)
Mode in the following program to open file for writing in a mode where new data will be added at the end of old data
file =open("poem.txt","__")
r
a
w
x
see the program and fill in the blank with correct statement.
(a)
Choose the correct statement to close a file stream named myfile:
myfile.terminate()
myfile.end()
myfile.close()
myfile.remove()
See the following code snippet and fill in the blank with appropriate statement
(a)
Fill in the blank with appropriate statement.
(a)
which function is used to read records from a binary file?
pickle.load(f)
pickle.read()
pickle.open()
pickle.dump(l,f)
write statement to use the required module for working with comma separated values (csv) files.
(a)
Write the appropriate statement in the blank.
(a)
Which statement(s) is/are true to open a binary file "Record.dat" for reading and writing.
file =open("Record.dat","wb")
file =open("Record.dat","rb")
file =open("Record.dat","ab")
file =open("Record.dat","rb+")
