Advertisement
simeonshopov

2D rectangle area+perimeter

Sep 3rd, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. x1=float(input())
  2. x2=float(input())
  3. y1=float(input())
  4. y2=float(input())
  5. width=max(x1, x2)-min(x1, x2)
  6. height=max(y1, y2)-min(y1, y2)
  7. area=width*height
  8. perimeter=2*(width+height)
  9. print(area)
  10. print(perimeter)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement