I couldn't understand try, return blocks

i couldn’t understand try, return blocks.

Hey @premprakash.cr, can you please specify which thing in the video were u not able to understand ?..You can specify the time at which the video is not clear or you have doubt in. I’ll explain you in detail ! :+1:

Thanks ! :slightly_smiling_face:

try blocks, finally blocks at time 2:35.

try blocks, finally blocks at time 2:35.
try blocks, finally blocks at time 2:35

Okay so try-catch blocks are used to deal with exceptions that may arise when testing or running a program. So when there comes any exception in the try block, the control is transferred to the except block and then the statements inside except block are executed.

Finally is another special block in exception handling which is executed in any case inside the code. So finally block is like a mandatory execution block even if exception arises or no exceptions arises.
I would recommend you to go through this link for best explanation of exception handling in python :sweat_smile:

I hope this clears your doubt ! :slight_smile:
Happy Learning ! :+1:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.