[Tutor] exceptional behaviour

Karthik Gurumurthy karthikg@aztec.soft.net
Thu, 24 Jan 2002 07:48:43 +0530


>def div42():
>	denominator=input("What value will I divide 42 by?\n")
	if denominator == 0:
		raise "first problem"
	elif denominator == 1:
		raise "second problem"
	else:
>		print 42/denominator


>examples wouldn't work until I removed the 
>space from the raise string

i tried on python2.1 and it's working fine.
what is the error you are getting?
try a simpler one..

def func():
	raise "hello world"

func()


karthik.