· beginner
Functions and Error Handling
Package work so it can be reused, tested and trusted. Arguments, return values, scope, and handling failure deliberately instead of letting a script die at line one hundred.
Written in house, from the work rather than from a syllabus. Every example is one we would use ourselves, and every exercise is checked against the same engine that grades your answer.
What you’ll learn
- Write functions with clear inputs and one clear output
- Use positional, keyword and default arguments correctly
- Explain scope and why a function cannot see your loop variable
- Catch only the exceptions you can handle, and raise your own
- Use a context manager so cleanup always happens
- Split code across modules and import it
Before you start
- · Python Foundations and Data Structures in Python