assign that variable the actual exception object in this casei turned the exception into string and looked at the message to see what caused the valueerror notice that this text is exactly what python prints out if the error is not caught ( "valueerrormath domain error"if the exception doesn' match any of the expected typesthis program just prints general apology as challengeyou might see if you can find an erroneous input that produces the apology you can see how the try except statement allows us to write bullet-proof programs you can use this same technique by observing the error messages that python prints and designing except clauses to catch and handle them whether you need to go to this much trouble depends on the type of program you are writing in your beginning programsyou might not worry too much about bad inputhoweverprofessional quality software should do whatever is feasible to shield users from unexpected results study in designmax of three now that we have decisions that can alter the control flow of programour algorithms are liberated from the monotony of step-by-stepstrictly sequential processing this is both blessing and curse the positive side is that we can now develop more sophisticated algorithmsas we did for our quadratic solver the negative side is that designing these more sophisticated algorithms is much harder in this sectionwe'll step through the design of more difficult decision problem to illustrate some of the challenge and excitement of the design process suppose we need an algorithm to find the largest of three numbers this algorithm could be part of larger problem such as determining grades or computing taxesbut we are not interested in the final detailsjust the crux of the problem that ishow can computer determine which of three user inputs is the largesthere is program outline we need to fill in the missing part def main() eval(input("please enter three values")missing code sets max to the value of the largest print("the largest value is"maxbefore reading the following analysisyou might want to try your hand at solving this problem strategy compare each to all obviouslythis program presents us with decision problem we need sequence of statements that sets the value of max to the largest of the three inputs and at first glancethis looks like three-way decisionwe need to execute one of the following assignmentsmax max max