exceptions

Aleksei Guzev aleksei.guzev at bigfoot.com
Fri Oct 6 00:06:00 EDT 2000


The problem is I need place the try block otside the function :)))

>>-----Original Message-----
>>From: python-list-admin at python.org
>>[mailto:python-list-admin at python.org]On Behalf Of Alex
>>Sent: Thursday, October 05, 2000 11:30 PM
>>To: python-list at python.org
>>Subject: Re: exceptions
>>
>>
>>
>>You just have the try block in the wrong place.  Try something like
>>this:
>>
>>def f(divident):
>>	L=[2,4,5,0,5,0,8]
>>	for divisor in L:
>>                try:
>>		        print divident/divisor
>>                except:
>>                        print '<Division by zero>'
>>f(100)
>>
>>Alex.
>>
>>-- 
>>Speak softly but carry a big carrot.
>>
>>-- 
>>http://www.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list