class Div: def doDivision (self): inputOK = False while (inputOK == False): try: num = input ("Enter numerator: ") denom = input ("Enter denominator: ") quot = num / (denom * 1.0) inputOK = True except ZeroDivisionError: print "Denominator cannot be zero" print num, "divided by", denom, "equals", quot def fun (): print "Just to contrast the call to a function vs. class method" def main (): aDiv = Div () fun () aDiv.doDivision() main ()