What mode should you open a file in to write to it without deleting its existing content?
- append mode
- create mode
- update mode
- write mode
To write to a file without deleting its existing content, you should open the file in 'write mode' ('w'). It creates a new file if it doesn't exist.
Loading...
Related Quiz
- For which of the following OS is Python NOT available by default?
- How can you implement a switch-case like behavior in Python?
- In which scenarios is it most appropriate to use a metaclass instead of a class?
- In Python’s unittest framework, the ____ method is used to compare whether two values are equal.
- To check the version of Python installed, one can use the command python _______.