from exceptions import * class neg(Exception): pass while True: try: x = float(raw_input("enter an number")) if x < 0: raise neg, x print 1/x except ValueError, value: print "pleas give me just numbers ",value except ZeroDivisionError, value: print " can't divid by zero ",value except neg, v: print " %s is not valide just positive numbers" % (v) except: print "another one" raise else: print "no exception"