Error Handling | try...except...finally block | Python for Data Science | Learn Python

Published: 11 November 2020
on channel: Tech Programmer
97
like

In this video, I explain about how we can handle different error situations in our code. Python provides convenient try..except and finally blocks to handle different scenarios.

In this video, I start with very simple try...except block to handle every kind of error in single except block. I also demonstrate different ways to handle multiple different types of errors in separate except blocks.

Later in the video, I discuss about how we can make use of "raise" keyword to throw our own custom errors when an abnormal or unexpected situation arises in code. Finally, I talk about how we can handle files using try...except and finally block to ensure that we are not leaving any unclosed resources.

Introduction [0:01]
Different kinds of errors [1:38]
Simple try...except example [4:13]
Handling multiple errors [5:34]
Handling different errors in same except block [9:25]
'as' keyword in Python [12:11]
Raise custom errors [13:26]
try...except...finally demo in Python code [16:14]

If you like our content, click on SUBSCRIBE button and click on Bell icon to receive latest and greatest updates of my video lessons.

Follow us on Facebook, Twitter, Instagram

Facebook Link:   / techprogrammer1  
Twitter Link:   / techprogrammer1  
Tumblr Blog: https://www.tumblr.com/blog/techprogr...


On this page of the site you can watch the video online Error Handling | try...except...finally block | Python for Data Science | Learn Python with a duration of 16 minute 40 second in good quality, which was uploaded by the user Tech Programmer 11 November 2020, share the link with friends and acquaintances, this video has already been watched 97 times on youtube and it was liked by like viewers. Enjoy your viewing!