Q. Which of the following opens a file for writing?
β
Correct Answer: (A)
open('file.txt', 'w')
Explanation: `'w'` mode opens a file for writing, truncating it first.