Q. Which mode is used to write to a file, creating it if it doesn't exist?
β
Correct Answer: (B)
w
Explanation: The 'w' mode writes to a file and creates it if not present.