Introduction to Python Exceptions

A Python program terminates as soon as it encounters an error. In Python, an error can be a syntax error or an exception. In this course, you will see what an exception is and how it differs from a syntax error. After that, you will learn about raising exceptions and making assertions. Then, you’ll finish with a demonstration of the try and except block.

What’s Included:

About Darren Jones

Darren Jones Darren Jones

With 20 years as a teacher of music technology, Darren is keen to bring his skills to the Python table.

» More about Darren

Each tutorial at Real Python is created by a team of developers so that it meets our high quality standards. The team members who worked on this tutorial are:

Participant Comments

Kumaran Ramalingam on June 13, 2021

Thank you so much Darren Jones: I believe in learning basics to the core would be the first best step we have to do on any technology. once we know it we can crack it. I am an Automation Developer working on infrastructure layer required more Error handlings and exceptions on case to case. Thanks for making me easily understand this tricky concept in Python. I will start from here.

L Pedigo on April 20, 2021

This is a good lesson and I understood the material well once finished. I had been watching/reading other courses on this subject (try, except, assert) and was still not clear on how to use them. This course was way easier to understand! Very well structured and presented. Thanks for your efforts!

Abderraouf Z on Nov. 21, 2020

Great course! Very good explanations.

rklyba on July 5, 2019

Thank you.It’s very simple and clear. Now I gonna read “Python Exceptions: An Introduction”

Peter T on March 31, 2019

Great class, albeit, very short, even though it seemed to cover all of the features of Exceptions in an extremely clear & succinct way. I look forward to seeing more courses by Darren.

andrewcheryl on March 26, 2019

Super helpful and clear!

Chaitanya on March 21, 2019

A nice way of explaining the introduction part about try, except, else, finally

Blaise Pabon on March 19, 2019

Now I realize that I never really understood try, catch, finally.

Daniel on March 18, 2019

Great videos. Very helpful.

Anonymous on March 16, 2019

Very helpful. Straight to the point!

Anonymous on March 15, 2019

Really helpful! I can use what I learned today!

Paul on March 15, 2019

Well done. Good, clear, concise overview.

« Browse All Courses