184k views
4 votes
Which of the following statements is false about working with files in Python?

a) The open() function is used to open a file.
b) The write() method is used to read data from a file.
c) The close() method is used to close a file.
d) The readline() method is used to read a single line from a file.

User Keram
by
7.3k points

1 Answer

4 votes

Final answer:

The false statement is that the write() method is used to read data from a file.

Step-by-step explanation:

The false statement about working with files in Python is b) The write() method is used to read data from a file.

The open() function is used to open a file. The write() method, on the other hand, is used to write data to a file. The close() method is used to close a file after accessing it. The readline() method is used to read a single line from a file.

User Adeelmahmood
by
7.1k points