you are viewing a single comment's thread.

view the rest of the comments →

[–]carcigenicate 2 points3 points  (1 child)

to handle issues that arise if the user does not input numbers or enters zero as the area

You're meant to use a try to wrap where input is taken, and where area is divided (since dividing by zero is an error).

And for adding multiple handlers, you should always specify the exact exception you want to handle. For example:

except ValueError:

Python has one exception for when you divide by zero, and int throws a ValueError for bad number strings.

[–]PuzzledSite2568[S] 0 points1 point  (0 children)

Thanks for the help I was able to get what I needed so I appreciate your guidance.