>>> try: ... x = 1/0.3 ... print 'reciprocal of 0.3 is', x ... x = 1/0.0 ... print 'reciprocal of 0.0 is', x ... except: ... print 'error: no reciprocal' reciprocal of 0.3 is 3.33333333333 error: no reciprocal