On Thu, Jun 03, 2010 at 11:42:16PM -0700, Chris Rebert wrote:
> >>> try:
> ... x[1]
> ... except IndexError as e:
> ... print "Got error:", e.args[0] # grab the error message
> ...
> Got error: list index out of range
Thanks a lot. This example solved what the tutorial could not.
With war
On Thu, Jun 3, 2010 at 11:31 PM, Payal wrote:
> Hi all,
> I am trying to learn exceptions and have few small doubts from
> http://docs.python.org/tutorial/errors.html
> There are many statements there of the form,
>
> ... except Exception as inst:
> do something
>
> ... except ZeroDivisionE