Question: ( Python problem ) 9 . 3 . 2 : Instance methods triangle 1 and triangle 2 are instances of the Triangle class. Attributes height

(Python problem)9.3.2: Instance methods
triangle1 and triangle2 are instances of the Triangle class. Attributes height and base of both triangle1 and triangle2 are read from input. In the Triangle class, define instance method compute_area() with self as the parameter to return the product of attributes height and base divided by 2.
Click here for example
Ex: If the input is:
54
88
32
184
then the output is:
First triangle's area: 2376.0
Second triangle's area: 2944.0
 (Python problem)9.3.2: Instance methods triangle1 and triangle2 are instances of the

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 Databases Questions!