English

In which of the file open mode, the new content will be overwritten on the old content?

Advertisements
Advertisements

Question

In which of the file open mode, the new content will be overwritten on the old content?

Options

  • <r>

  • <w>

  • <a>

  • <rb>

MCQ
Advertisements

Solution

<w>

Explanation:

The file is opened in write mode when you type <w>. If the file doesn't already exist, it will be created. If it already exists, all of its contents will be rewritten.

shaalaa.com
Opening and Closing a Text Files in Python
  Is there an error in this question or solution?
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×