#Python HW

5 messages · Page 1 of 1 (latest)

acoustic elk
#

My code:

    def __init__(self, x, y):
        self.x = x
        self.y = y


class Rectangle:
    def __init__(self, location, width, height):
        self.location = location
        self.width = width
        self.height = height
        
    def getWidth(self):
        return self.width

    def getHeight(self):
        return self.height

    def perimeter(self):
        perimeter = 2 * (self.width + self.height)
        return perimeter

    def grow(self, delta_width, delta_height):
        self.width += delta_width
        self.height += delta_height

    def move(self, dx, dy):
        self.location.x += dx
        self.location.y += dy```
#

first ss are instructions

brave jacinth
#

Do you understand the error message?

acoustic elk
#

no

brave jacinth
#

Do you know what an object and what an attribute is?