3,455 views
24 votes
24 votes
T/F if a file with the specified name already exists when the file is opened and the file is opened in 'w' mode, the file will be overwritten.

User Etan Reisner
by
2.9k points

1 Answer

25 votes
25 votes

Answer:

True

Step-by-step explanation:

If a file with the same name already exists, its contents are discarded and the file is treated as a new empty file. For example, in the following program, if “test. txt” already exists, its contents are removed and “GeeksforGeeks” is written to it.

User Eric Sanchez
by
2.9k points