Exception Handling in Python | TRY EXCEPT in Python | Python Tutorial for Beginners #8

preview_player
Показать описание
Exception Handling in Python can be done using try except in python. Handling exceptions is one of the most important aspects of a good python program hence in python we can handle exceptions by placing the block of code which we assume to be causing error inside a try and except block.
Any error caused by the block of code within the try except clause won’t be returned to the user but will be handled by the except block.

In Python, we can also raise user defined exceptions using the raise Exception clause. Raise exception can be used anywhere in the code to cause an error based on certain conditions.
We can raise and exception within the try except block so the user defined error can be caught by the try except block.

Within try except exception handling in python, we can also use ELSE and FINALLY clause. Block of code within else will be executed when the code within try does not throw an error. If the block of code within try causes an exception, then the except block will be called and the block of code within except will be executed.
Block of code within finally, will be executed every time. Meaning whether there is an exception or not, if you have mentioned finally in your try exception block then the block of code within finally will always be executed.

This video is aimed at complete beginners who are just getting started with programming or with python programming. The concepts are explaining in the most basic manner so anyone can understand it.

The purpose of this Python tutorial series for beginners is to explain python programming in the most simplest manner by providing simple examples and working out interesting and meaningful python programs which should be a better way to learn programming especially for the beginners.

So please make sure to check that out as well.

Other video’s in this tutorial series:

Local and Global Scope in Python | Local and Global Variables | Python Tutorial for Beginners #7

What is a FUNCTION in Python | Python Functions | Python Tutorial for Beginners #6

Import modules in Python | Import module from different directory | Python Tutorial for Beginners #5

WHILE loop and FOR loop in Python | LOOP statements in Python | Python Tutorial for Beginners #4

IF ELSE ELIF statement in Python | IF ELSE Statement in Python | Python Tutorial for Beginners #3

What is a VARIABLE in Python | Python Variables | Python Tutorial for Beginners #2

What are DATA TYPE, OPERATORS and EXPRESSION in Python | Python Tutorial for Absolute Beginners #1

Please like, subscribe and leave a comment if you found the video to be useful. Also please make sure to click on the notification bell to be notified of my latest video’s.

🔴 WATCH MORE VIDEOS HERE 👇

✅ SQL Tutorial - Basic concepts:

✅ SQL Tutorial - Intermediate concepts:

✅ SQL Tutorial - Advance concepts:

✅ Practice Solving Basic SQL Queries:

✅ Practice Solving Intermediate SQL Queries:

✅ Practice Solving Complex SQL Queries:

✅ Data Analytics Career guidance:

✅ SQL Course, SQL Training Platform Recommendations:

✅ Python Tutorial:

✅ Git and GitHub Tutorial:

✅ Data Analytics Projects:

THANK YOU,
Thoufiq
Рекомендации по теме
Комментарии
Автор

I was looking for python tutorials masterclass But found on YouTube Yours is one of the clear and easy to follow

girishnaveen
Автор

Fantastic explanation for new programmers. Thank you!

stefanhart
Автор

SQL learnt from your videos only again started python sir thank u for the teaching sir

kohilaraghupathi
Автор

How you re given such clear information shortly with optimised example great work thank u for the video

kohilaraghupathi
Автор

Thank you for making this so easy to understand!

Tinaisspooky
Автор

Excellent presentation! Thank you for all the good help.

cookgs
Автор

Very well explained, sir .. Thank you

pradeeppathak
Автор

Keep up the great work👍 You are doing fab👌Investing your time in sharing your knowledge👌

fathimafarahna
Автор

11:00 -> raise exception to give custom exception message

Basket-hbjc
Автор

U made this topic so easy 4 me. Thanks

vish
Автор

Hi, what if I pass three arguments from the function call like add(10, 20, 30) and how can I handle this.
Thanks in advance.

nanduriraju
Автор

I have a question:
6:00 If we have default Exception to handle exceptions then why do we need to explicitly handle each exceptions? We can simply use the default one
Is it because to improve performance of code or simply to have personalized error message?

Thanks

amyyyy
Автор

Thoufiq Sir,

In the example given at 12:00 Mins, the program won't ever go to "except part"....

So is it given as a mandatory variable to be passed in try & except case???

_Sujoy_Das
Автор

why the same code gives me 'none ' after every print(function()) statement

rishabhshar