高仿模拟练习,补全代码空缺,答案点击按钮展开
将字符串 "hello" 写入文件 a.txt(覆盖写)。
with open("a.txt", ____) as f: f.write("hello")
"w"
open 模式 "w" 表示只写覆盖;with 语句会自动关闭文件。