The Real Python Podcast cover image

Making Your Notebook Interactive and Using Python's Assert

The Real Python Podcast

00:00

Python, Assert, D Bug and Test Your Code Like a Po

Assert is kind of like a d bug statement, but with some teeth. If the condition isn't true, it raises an exception a, forcing the program to exit. Assert takes two arguments, the thing being asserted to be true, and an optional message to include in the exception. The cool thing about this is you can actually turn them off, so you don't actually have to hunt them down in your cot and remove them when you're done.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app