NEW
Font size
WorksheetsFile Handling
Total questions: 10
Worksheet time: 5mins
What is the first file handling operation mentioned in the text?
open
write
close
read
What does the 'R' parameter signify when opening a file in Python?
Read mode
Binary mode
Write mode
Append mode
What is used to remove the newline character when reading from a file?
.strip()
.delete()
.remove()
.cut()
What does setting a Boolean variable to false indicate in file handling?
File is empty
End of the file is reached
File is corrupted
End of the file is not reached
What parameter is used to append to a file in Python?
A
R
W
B
What is the correct order of operations for writing data to a file?
Write, open, close
Close, open, write
Open, close, write
Open, write, close
What does the '.write' method do?
Deletes data from a file
Opens a file for writing
Reads data from a file
Writes data to a file
What is data dependency?
A type of data error
A method to write data
A requirement for data to be in a specific order
A Python library for file handling
What does the 'A' parameter do when opening a file?
Opens the file in read-only mode
Clears the file before writing
Appends to the end of the file
Creates a new file
What is the purpose of the 'close' operation in file handling?
To free up resources
To rename the file
To save changes to the file
To delete the file
