Skip to content

Latest commit

 

History

History

0x05-python-exceptions

img

Exceptions and Exception handling

Intro

In this session, we will explore python exceptions, the different types of exceptions and how these exceptions can be handled.

Resources

  1. Errors and Exeptions
  2. Exception Handling
  3. Youtube
  4. Google

Learning objectives

By the end of this session, you should be able to explain to anyone the following concepts without the help of Google.

  • What’s the difference between errors and exceptions
  • What are exceptions and how to use them
  • When do we need to use exceptions
  • How to correctly handle an exception
  • What’s the purpose of catching exceptions
  • How to raise a builtin exception
  • When do we need to implement a clean-up action after an exception

Script Requirements

  • Allowed editors: vi, vim, emacs
  • All your files will be interpreted/compiled on Ubuntu 20.04 LTS using python3 (version 3.8.5)
  • All your files should end with a new line
  • The first line of all your files should be exactly #!/usr/bin/python3
  • Your code should use the pycodestyle (version 2.8.*)
  • All your files must be executable