thanks in advance the class below represents a group of shapes for instance a group 5150312

The class below represents a group of shapes. For instance, a group could be a square, a rectangle, and a triangle. Implement

The following cell should create a new group, and add both our line and rectangle from above to it. The output should look li

Thanks in advance

The class below represents a group of shapes. For instance, a group could be a square, a rectangle, and a triangle. Implement the area method for the Group class. The area of a group is just the total area of the shapes in the group. For the purpose of this assignment, we will not consider cases where shapes overlap, you simply need to add the areas of the shapes in a group independently. ]:class Group def init (self): self.c set def add (self, s): “”Add shape s to group””” self.c.add(s) def move (self, dx, dy): “””Move by dx and dy””” for s in self.c s.move (dx, dy) def area(self): pass #code here return area def str(self) “Group with:”. for s in self.c r r + ” n r= ” str(s) return r #YOUR CODE HERE The following cell should create a new group, and add both our line and rectangle from above to it. The output should look like: Group with: Line from (1, 2) to (5, 6) Rectangle at (-2, -3), width 2, height 3 In [2531 qi Group() gl.add(1) gl.add(r print (g1 Now, if we move every element in the group up one unit and to the right one unit, the output should look like: Group with Line from (2, 3) to (6, 7) Rectangle at (-1, -2), width 2, height 3 In 254] g1.move (1, 1) print (g1) In [243]: gi.area) == 6 Out [243] True

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now