common mistakes in this simple program

Ganesh Pal ganesh1pal at gmail.com
Tue Mar 15 11:56:18 EDT 2016


On Tue, Mar 1, 2016 at 2:41 AM, Martin A. Brown <martin at linux-ip.net> wrote:

> Please read below.  I will take a stab at explaining the gaps of
> understanding you seem to have (others have tried already, but I'll
> try, as well).
>
> I am going to give you four different functions which demonstrate
> how to use exceptions.  You may find it instructive to paste these
> functions into an interactive Python shell and try them out, as
> well.
>

Thanks Martin for beautifully demonstrating the use of exception  with
an example that's easy to understand.

Step 1: catch a specific Exception
Step 2: catch a specific Exception
Step 3: catch several different classes of Exception
Step 4: catch many different classes of Exception



More information about the Python-list mailing list