Exceptions

Tetsuo member16943 at dbforums.com
Tue Feb 4 10:35:45 EST 2003


> 
> class CorruptHardDiskError(Exception):
>     pass
>
> def Pythagoras(a,b):
>     raise CorruptHardDiskError, "Pythagoras is out"
>
> try:
> Pythagoras(18, "x")
> except CorruptHardDiskError:
> print "Wow"
> 

And where is the actual program that finds the hypotenuse? And why is
"pass" needed?

--
Posted via http://dbforums.com




More information about the Python-list mailing list