#21 - Exception Handling in Python

Publicado em: 01 Dezembro 2020
no canal de: Tech Vitals
254
6

Learn about Exception Handling in Python. Exception is an error that occurs while executing a code. When there is an error or bug in our code, Python will display an error message which is only understood by programmers. The clients or non-technical persons cannot understand the error message and they will have no idea what's wrong with the code. Python Exception Handling lets the programmers to handle such exceptions efficiently and provide the error message that can be easily understood by the clients or other non-technical persons.
For all the code that can raise an exception, we place them inside try block. We define the except block for the possible errors in the try block. If the code in try block has an error, python will execute the except block. We can define multiple except block of same try block so that we can handle each exceptions separately.
We can define finally block if we want to run some code even if the code has some errors or exception. We can also define else block which will only run if there is no error or exception in the code.
We can also define our own custom exception and raise the exception if certain condition is true.

Facebook:   / techvitals  


Nesta página do site você pode assistir ao vídeo on-line #21 - Exception Handling in Python duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Tech Vitals 01 Dezembro 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 254 vezes e gostou 6 espectadores. Boa visualização!