English

Write the file mode that will be used for opening the following file. Also, write the Python statement to open the following file: a text file “try.txt” in append and read mode. - Computer Science (Python)

Advertisements
Advertisements

Question

Write the file mode that will be used for opening the following file. Also, write the Python statement to open the following file:

a text file “try.txt” in append and read mode.

One Line Answer
Advertisements

Solution

“a+”

file_handle = open(“try.txt”, “a+”)

shaalaa.com
Types of Files in Python
  Is there an error in this question or solution?
Chapter 2: File Handling in Python - Exercise [Page 37]

APPEARS IN

NCERT Computer Science [English] Class 12
Chapter 2 File Handling in Python
Exercise | Q 3. c) | Page 37
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×