Advertisements
Advertisements
प्रश्न
Write the use and syntax for the following method:
open()
टिप्पणी लिखिए
Advertisements
उत्तर
To open a file in Python, we use the open() function. The syntax of open() is as follows:
file_object = open(file_name, access_mode)
This function returns a file object called file handle which is stored in the variable file_object.
Example: myObject = open(“myfile.txt”, “a+”)
shaalaa.com
Opening and Closing a Text Files in Python
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
