Lesson 7 of 14 · Structuring your code
Files and exceptions: with, try/except/finally, raising your own exceptions
Objective
Write programs that do not crash at the first surprise: read and write files properly, react to invalid input, a missing file or insufficient stock, and clearly report the errors of your own code.
This lesson is part of the full course
Unlock Python: Programming, Automation and Data Analysis to read every lesson, do the exercises, access the simulations and earn your certificate.
Already enrolled? Log in.