Advertisement
biswasrohit20

areaperi

Apr 26th, 2021
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. def perimeter(l, b):
  2. return 2 * (l + b)
  3.  
  4.  
  5. def area(l, b):
  6. return l * b
  7.  
  8.  
  9. length = float(input("Enter the length of the rectangle: "))
  10. breadth = float(input("Enter the breadth of the rectangle: "))
  11.  
  12. p = perimeter(length, breadth)
  13. a = area(length, breadth)
  14.  
  15. print(f'A {length} by {breadth} rectangle has an area of {a} and a perimeter of {p}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement