5) Exceptions Lesson

Conclusion: Python Exceptions

3 min to complete · By Martin Breuss

Contents

  1. Introduction

In this section, you've learned about exceptions in Python. You learned how to:

  • Catch exceptions with try and except
  • Handle exceptions in different ways
  • Use the except and the finally keywords
  • Raise exceptions
  • Write custom exceptions

You also learned about when and how to use exceptions in Python and when you should better avoid using them.

You can improve the stability of your programs with exceptions, and they are a valuable tool in your software developer's tool belt. If you feel like you want to dive deeper, then take a look at some of the additional resources to solidify your understanding:

Colorful illustration of a light bulb

Additional Resources

Another important tool to improve the stability of your code and make it more attractive for other developers to use is tests. Professional software development is a lot about writing good tests and making sure your code runs the way it's supposed to run. In the next section, you'll learn about how to implement tests in your Python programs.