Question: Integers rect _ length and rect _ width are read from input, representing the length and width of a rectangle. In the try block: Raise

Integers rect_length and rect_width are read from input, representing the length and width of a rectangle. In the try block:
Raise a ValueError exception with the message 'Rectangle length must be positive' if rect_length is less than or equal to 0.
Raise a ValueError exception with the message 'Rectangle width must be positive' if rect_width is less than or equal to 0.
Click here for example 1(invalid input - negative length)
Click here for example 2(invalid input - negative width)
Click here for example 3(valid input)
Integers rect _ length and rect _ width are read

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!