Question: 2, (10 points) Given the Python class below, pertorm the folloving tasks: a. Name all mutator methods b. Give the output e. Give code to
2, (10 points) Given the Python class below, pertorm the folloving tasks: a. Name all mutator methods b. Give the output e. Give code to create a sibling class to Rectangle named RightTriangle d. Give code to create a RightTriangle, RT, class Shape: def init_(self, width, height): self.w- width self,h = height def setwidth(self, width): self.w-width def setHeight (self, height): self.h- height class Rectangle (Shape): def name (self): return "rectangle" def area (self): return (self.w self.h) def main): r Rectangle (3, 6) r.setwidth (4) print ('The 'r.name ()+has an area of str(r.area())+ '.' main()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
