Computer Science - Class 12
Chapter 2 - File Handling in Python

Which of the following statements are true?

 

Answer:

When you open a file for reading ,

  • If the file does not exist, an error is given.

When you open a file for writing ,

  • If the file does not exist, a new file is created.
  • If the file exists, the existing file is overwritten with the new file.

Therefore all the options are correct.

 

So, the correct answer is (d).

Go Ad-free
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 14 years. He provides courses for Maths, Science and Computer Science at Teachoo