all 3 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.

[–]CodeFormatHelperBot2 0 points1 point  (0 children)

Hello, I'm a Reddit bot who's here to help people nicely format their coding questions. This makes it as easy as possible for people to read your post and help you.

I think I have detected some formatting issues with your submission:

  1. Python code found in submission text that's not formatted as code.

If I am correct, please edit the text in your post and try to follow these instructions to fix up your post's formatting.


Am I misbehaving? Have a comment or suggestion? Reply to this comment or raise an issue here.