Answer to Question #175890 in Python for Find permiter of overlapping rectangles

Question #175890

Find the perimeter of overlapping rectangles , given the top right and bottom left corners.


1
Expert's answer
2021-03-26T13:05:08-0400
# Find the perimeter of overlapping rectangles
s = input('Top right conner: ')
s = s.split()
top = float(s[0])
right = float(s[1])

s = input('Bottom left conner: ')
s = s.split()
bottom = float(s[0])
left = float(s[1])

perimeter = 2*abs(bottom-top) + 2*abs(right - left)
print(f'The perimeter is {perimeter}')

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS