Single Choice Not Set

QWhich of the following statements are true?

ID: #3654 Python File Handling 310 views
Question Info
#3654Q ID
Not SetDifficulty
Python File HandlingTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A When you open a file for reading, if the file does not exist, an error occurs
  • B When you open a file for writing, if the file does not exist, a new file is created
  • C When you open a file for writing, if the file exists, the existing file is overwritten with the new file
  • D All of the mentioned
Correct Answer

Explanation

Given all options are true, when we open a file for recording, if the file does not exist, an error occurs. When we open a file for writing, if the file does not exist, a new file is created.
When we open a file for writing, if the file exists, the existing file is overwritten with the new file.

Share This Question

Challenge a friend or share with your study group.