Debugging in Python

Learn how to use exceptions, assertions, and other statements to debug and fix errors in your Python code.

TECHNOLOGIES

Core Python

WATCH TIME

16 minutes

Lessons

Logging to the Console

Learn how to log into Python console on PyCharm as a way to interactively debug your code.

8 min

Making Assertions

Understand here how to use an assertion, a checking mechanism that you can use while testing your program.

5 min

Raising Exceptions

Learn how to use raise, try, except in your Python code to elegantly handle errors that may arise.

5 min

Hey! I’m Avi, and I’ll teach you how to build!

I'm Avi, your new Python instructor and founder of The Codex.

Three years ago I was stuck. I wasn’t learning anything in my theory-filled CS classes, my friends took pictures of me sleeping in lecture, and I was questioning why I was even learning CS to begin with. I had ideas but I was clueless on execution.

After watching hours of webcasted YouTube videos, enrolling in course after course, and struggling to stay motivated, I finally obtained the skills to bring my ideas to life. I realized how lonely and gruesome this process was.

If you’re a student just like me, you know exactly what it’s like to be stuck in course hell. The best programmers of today learned by doing, not by reading syntax in a textbook.

Join The Codex. Become a creator.

Savvy Students ❤️ The Codex

The Codex has helped hundreds of students find jobs and build their dream projects.

“For the first time in my life I’ve found a platform that can keep me engaged for more than 5 minutes. Project on The Codex are entertaining, informative, and more valuable than the countless hours of lectures I watched at 2x speed in school.”

Maddie Wilson

University of Toronto, 2023