Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Coddy

Exception Handling in Python

via Coddy

Overview

In this chapter, you will learn one of the most important concepts in programming which is Exception Handling. Exception Handling is the key if you want to develop solid and unbreakable programs. Exception Handling is the process of responding to exceptions which breaks program.

Prerequisites:

  • Basic Python skills
  • Basics of Object Oriented Programming

Syllabus

Introduction to Exceptions

  • What is Exception ?
  • Exception vs Error

Exception Handling

  • try-except
  • else
  • Finally
  • Printing Exception message
  • Printing Exception Name
  • Handling Multiple Exceptions
  • sys module for information

User-defined Exceptions

  • Types of Exceptions
  • Raising an Exception
  • User Defined Exception
  • Exception Handling Exercise- 1
  • Exception Handling Example-2
  • Exception Handling Example-3

Customization/best practices

  • Customize Tracebacks

Reviews

Start your review of Exception Handling in Python

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.