When you open a file for writing, if the file does not exist, an error occurs.
False
Reason — When a file is opened for writing using w mode (text files) or wb mode (binary files), if the file does not exist, file is created.