Home »
MCQs »
Python MCQs
Amongst which of the following is / are the key functions used for file handling in Python?
62. Amongst which of the following is / are the key functions used for file handling in Python?
- open() and close()
- read() and write()
- append()
- All of the mentioned above
Answer: D) All of the mentioned above
Explanation:
The key functions used for file handling in Python are: open(), close(), read(), write(), and append(). the open() function is used to open an existing file, close() function is used to close a file which opened, read() function is used when we want to read the contents from an existing file, write() function is used to write the contents in a file and append() function is used when we want to append the text or contents to a specific position in an existing file.