Respuesta :

Answer:

The init method of the Polygon class defines two attributes 'x' and 'y' which are both lists. To add points to the lists x and y, define the add_point method;

def add_point(self, x, y) :

   self._x_points.append(x)

   self._y_points.append(y)

Explanation:

A class is a blueprint of a data structure. It contains the attributes and methods of the data structure type. Attributes are features of a data structure defined as variables that can be either a class attribute or an attribute of the instance of the class object. A method is just a function defined in a class.

The add_point method in the polygon class accepts two parameters and appends the values to the x and y lists defined in the init method.

ACCESS MORE