若文件log.txt已存在,执行以下代码后文件内容被清空,仅保留New log entry 。
with open("log.txt", "w") as f: f.write("New log entry")
正确
错误