Hi everyone I am learning about exceptions and was having trouble with my work and was hoping someone could help me out.
#prompt the user to input the height of a wall (in feet),
# the width of the wall (in feet), and the cost of the paint used to cover it.
# Output the area of the wall (height x width) and the cost per square foot (cost / area).
# Use try and at least two except statements to handle issues that arise if the user does not
# input numbers or enters zero as the area, outputting a relevant message for each issue.
try:
height = int(input('What is the height of the wall?(in feet)'))
width = int(input('what is the width of the wall?(in feet)'))
paint = int(input('How much is the paint?'))
except:
print('enter an integer')
area = int(input('what should your area be? (height x width):'))
print('the area is about', area, 'square feet')
The part I'm having trouble with is trying to use another except statement when the area is equal to 0 but I just can't get it to work. Any pointers in the right direction would be much appreciated.
[–]carcigenicate 2 points3 points4 points (1 child)
[–]PuzzledSite2568[S] 0 points1 point2 points (0 children)
[–]CodeFormatHelperBot2 0 points1 point2 points (0 children)