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
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
