what did i do wrong missing 1 required positional argument: ‘self’

  class, python, self
class Area(object):
    def __init__(self, base, height):
        self.base = base
        self.height = height

    def calculation(self):
        return(self.base * self.height)

area = Area(15, 2)
print(Area.calculation())

Source: Python Questions

LEAVE A COMMENT