Lab Question I Extending Graphical Shapes Download shapes py from the website and extend it with dass Circle

computer science


Lab Question I (Extending Graphical Shapes): Download shapes .py from the website and extend it with dass Circle, class Polygon, and a method area. Classes Circle and Polygon should inherit from 3hape For circles, at creation the radius has to be specified and the _str_ method should return a string in the same style as for Line and Rectangle. For rectangles, at creation, the list of vertices has to follow the example below precisely. Add method is to classes Line, Rectangle, circle. The area of a line is zero and the areas of rectangles and circles should be computed in the usual way For this, import pi from math. The area of a non-self-intersecting polygon with; vertices is defined as ‘r-1

Related Questions in computer science category