# Raises a divide-by-0 exception dividend = 36.0 divisor = [3.0, 4.0, 0.0, 5.0] for d in divisor: try: quotient = dividend / d print str(dividend) + ' / ' + str(d) + ' = ' + str(quotient) except ZeroDivisionError: print 'found ' + str(d) + ' in the list of divisors--skipping'