So this we're going to see the exception handling in Python.
So there are some few exceptions you need to handle, say, division by zero.
So let's go to camp physicals to try to do zero.
So now let's execute this one.
So it just doesn't matter it.
So now let's, uh, uh, step into printouts, right?
So you can see we got deal and this principle did not execute, so whenever there is an exception in
Python already language, the program stops at that point.
So you need to handle that exception and pass through that exception to Utah.
So what you're gonna do is you want to separate and you need to put the internation.
But this one and that system is equal to.
2.0.
So whenever there is an exception and you need to catch that using this, except so except you need
to specify the error or the exception you want to, and that is the general, as you can see, the order,
which suggests to me the reason I wrote.
And I can put the record and I can print so so zero either has been accurate and to just divide by zero
is not possible.
So now let's go ahead and run this group, sorry.
They can see my output has been printed because the script does not stop there, only then you can see
the print statement.
Now, I can also say I can write my code in this except work, but you cannot write the code of another
Ruckersville.
So that's just before going to writing other code, you need to say as yet.
So you can also catch this activation as an object and you can just print feedback on the class so it
will print out the what type of error we have got.
So we can also say that accept that solution.
So this is this will go to all the exceptions and it will print whatever exception you have got.
And see, you have got the general you can only to mention any of these.
Also, this is like a binary catching every other exception you can just to say pass here.
So this is how you handle the roses in the tree except rock.
So if there is no error in this tree and you want to execute some of the code, you can put the else
block.
So you want to try this code and there are any exceptions.
You are going to this except rock, unless you want to go to this block.
It's a pretty tough.
And to to to sort of run the script, we got the one, so we have executed some other instead of this
exceptionally successfully or come with this exception.
And there is another thing.
Finally, and this block will execute, however, if you got any exception are not.
So he's like a distracter in any other.
So I do not I should not the structure, the shuttle, but it's doing the thing.
It will run, uh, after the patankar, so it will run as a final rock.
And if I run this, no matter what, if I got exceptional, not this final rocket, you can see I am
going to execute.
Now let's change it to zero.
Now we will get the exception and how we found that we got exception because this is not like that,
because we got the exception and we just passed it over and the final rule has been executed.
So this finally block is used to release some resources, I suppose, in trying to open a file.
And you can close this in here.
So to make sure that our resources are crossette efficiently so that all the basics of what is exceptionally
dry except and certain finally.
So, you know, it's just easier to, uh, catch all the exceptions and pass through this.
So we do not deal with any other exceptions as well.
So these are about the basics of the exception handling.
I hope I have understood.