for the previous codemaybe yesmaybe no with our recent experience in object-oriented principleswe can write an object-oriented version in record time let' compare them import math class pointdef __init__(selfxy)self self def distance(selfp )return math sqrt((self - )** (self - )** class polygondef __init__(self)self vertices [def add_point(selfpoint)self vertices append((point)def perimeter(self)perimeter points self vertices [self vertices[ ]for in range(len(self vertices))perimeter +points[idistance(points[ + ]return perimeter as we can see from the highlighted sectionsthere is twice as much code here as there was in our earlier versionalthough we could argue that the add_point method is not strictly necessary nowto understand the differences little betterlet' compare the two apis in use here' how to calculate the perimeter of square using the object-oriented codesquare polygon(square add_point(point( , )square add_point(point( , )square add_point(point( , )square add_point(point( , )square perimeter(