topic/Reading and Writing Files
Start Test
Question No
Title
Type
Marks
484.
How can you read the entire contents of a file named "data.txt" into a string?
MCQ
5
485.
What is the purpose of thewrite()method when used with a file object?
MCQ
5
486.
How can you close a file in Python after performing operations on it?
MCQ
5
487.
In Python, what does thewithstatement provide when working with files?
MCQ
5
483.
How can you open a file named "example.txt" in Python for reading?
MCQ
5