The try and except keywords allow you to catch exceptions generated by runtime errors in your code, and take appropriate action to remedy the errors and/or alert the user. In this video I introduce the syntax and show you, as an example, how to prevent a possible division by zero from crashing your code.
Embedded video, part of the online courses listed below. For the full context, code and links to more videos, see the repositories linked here:
Computer Programming at Queen Mary, University of London
https://github.com/fsmeraldi/cp-excep...
Coding for Scientists at Queen Mary, University of London
https://github.com/fsmeraldi/c4s-exce...
On this page of the site you can watch the video online The try-except clause in Python: handling runtime errors in your code (and preventing crashes) with a duration of hours minute second in good quality, which was uploaded by the user PatchyPython 20 October 2023, share the link with friends and acquaintances, this video has already been watched 47 times on youtube and it was liked by 1 viewers. Enjoy your viewing!