Exceptions allow you to write code which may not work, and then handle the successful and failed cases separately. The four clauses in Python Exception handling are try, except, else, and finally. These give you the ability to handle an error (except), a success (else), or either (finally). Today we introduce the most common types of exceptions in Python, and then show you how to use all 4 exception clauses.
We would like to thank our Patrons “Birds Eat Bees”, Juan Guillermo Henao, Andrew Mengede, Martin Stephens, Carlos Araujo, and Tracy Karin Prell. Their generous support on Patreon helped make this video possible.
To learn Python, you can watch our playlist from the beginning:
To help us continue making videos, you can support Socratica at:
We also accept Bitcoin! 🙂
Our address is: 1EttYyGwJmpy9bLY2UcmEqMJuBfaZ1HdG9
If you’d like a reference book, we recommend “Python Cookbook, 3rd Edition” from O’Reilly:
The Mythical Man Month – Essays on Software Engineering & Project Management
You can also follow Socratica on:
- Twitter: @socratica
- Instagram: @SocraticaStudios
- Facebook: @SocraticaStudios
Python instructor: Ulka Simone Mohanty (@ulkam on Twitter)
Written & Produced by Michael Harrison (@mlh496 on Twitter)
Yoda, Star Wars The Exhibition, Madrid
Author: Daniel Huntley