KnowledgeBoat Logo
|

Computer Science

Write statements to open a binary file 'C:\Myfiles\text1.dat' in read and write mode by specifying the file path in two different formats.

Python Data Handling

1 Like

Answer

The two different formats of specifying file path for opening the file C:\Myfiles\text1.dat in read and write mode are:

  1. file1 = open("C:\\Myfiles\\text1.dat", "rb+")

  2. file2 = open(r"C:\Myfiles\text1.dat", "rb+")

Answered By

1 Like


Related Questions