ralphdc09

its102.md.wk.11.fn.13.number03

Nov 26th, 2021 (edited)
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. class Rectangle:
  2.     def __init__(self, ln, wd):
  3.         self.length = ln
  4.         self.width = wd
  5.  
  6.     def rectangle_area(self):
  7.         return self.length * self.width
  8.  
  9.  
  10. newRectangle = Rectangle(14, 12)
  11. print("The area of the rectangle is " + str(newRectangle.rectangle_area()))
  12.  
Add Comment
Please, Sign In to add comment