KnowledgeBoat Logo

Computer Science

Write a statement in Python to perform the following operations :

(a) To open a text file "BOOK.TXT" in read mode

(b) To open a text file "BOOK.TXT" in write mode

Python File Handling

1 Like

Answer

(a) To open a text file "BOOK.TXT" in read mode : file1 = open("BOOK.TXT", "r")

(b) To open a text file "BOOK.TXT" in write mode : file2 = open("BOOK.TXT", "w")

Answered By

3 Likes


Related Questions