Errors, Files and Data Formats
Handle errors on purpose, read and write files safely, speak CSV, JSON, TOML and YAML, log like a professional, and debug with real tools.
Real programs meet things that go wrong: a file is missing, a number arrives as text, a network call fails. This phase teaches exceptions properly: how to catch them, how to raise your own, how to group several at once, and how context managers guarantee cleanup.
Then it moves to data that lives outside your program. You will read and write text files, build paths that work on every operating system, and convert data to and from the formats the world uses: CSV, JSON, TOML and YAML. You will also learn why one format, pickle, must never be opened from a stranger.
The phase ends with the two habits that make you effective in a real codebase: logging instead of print, and debugging with a method instead of by guessing. These are the skills behind every reliable AI pipeline that reads files, calls APIs and must keep going when one item fails.
Practise this phase
Hands-on exercises: write the code, run it, and press Check to have it tested automatically.