Check sibling questions
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).

Introducing your new favourite teacher - Teachoo Black, at only ₹83 per month

CA Maninder Singh's photo - Expert in Practical Accounts, Taxation and Efiling

Made by

CA Maninder Singh

CA Maninder Singh is a Chartered Accountant for the past 12 years. He also provides Accounts Tax GST Training in Delhi, Kerala and online.