Apr-22-2020, 06:15 AM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
class Rectangle(): def __init__( self , x, y): self .x = x self .y = y def dRec_area(self1, self2): area = (self1.x * self1.y) + (self2.x * self2.y) return area x1 = input ( "Please insert the width: " ) y1 = input ( "Please insert the length: " ) rectangle1 = Rectangle(x1, y1) x2 = input ( "Please insert the width: " ) y2 = input ( "Please insert the length: " ) rectangle2 = Rectangle(x2, y2) print (rectangle1.rectangle2.dRec_area()) |