Question: use python code Q2. (15 points) Define a class named EquilateralTriangle. An equilateral triangle is a triangle attributes: which all the three sides are same

use python code

use python code Q2. (15 points) Define a class named EquilateralTriangle. An

Q2. (15 points) Define a class named EquilateralTriangle. An equilateral triangle is a triangle attributes: which all the three sides are same length. The class contains following methods and init_(): method which initializes the side 'a' of an equilateral triangle object . area(): returns the area, where area= . set_side(): sets the value of current side to a new value get_side(): returns the value of the current side 1.Instantiate one object of the class with side to be 10 and 2.return the area of the triangle. 3.Then set the side of the same object to be 20 using set_side() method, *return the new side using get_side() and 5.then return the new area. Your answer here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!