Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Python
/
Python
What happens when Path("notes.txt").write_text("new") targets an existing file?
from Python
intermediate
1 min
What happens when Path("notes.txt").write_text("new") targets an existing file?
It replaces the file contents with "new"
It appends "new" to the existing contents
It refuses to write unless overwrite=True is passed
Check
Ask AI about this kata
Report an error
previous kata
What does Path("reports") / "daily.json" do?
Quiz
A new version is available
Reload