Exceptions

Tetsuo member16943 at dbforums.com
Tue Feb 4 16:35:45 CET 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