Create a class, Triangle. Its_init_() method should take self, angle1, angle2, and angle3 as arguments. Make sure to set these appropriately in the body of theinit_()method. Create a variable named...


Python: Use class abd pointers


Create a class, Triangle. Its_init_() method should take self, angle1, angle2, and angle3 as arguments. Make sure to set these appropriately in the body of theinit_()method.<br>Create a variable named number_of_sides and set it equal to 3.<br>Create a method named check_angles. The sum of a triangle's three angles is It should return True if the sum of self.angle1, self.angle2, and self.angle3 is equal 180, and False otherwise.<br>Create a variable named my_triangle and set it equal to a new instance of your Triangle class. Pass it three angles that sum to 180 (e.g. 90, 30, 60).<br>Print out my_triangle.number_of_sides and print out my_triangle.check_angles ().<br>

Extracted text: Create a class, Triangle. Its_init_() method should take self, angle1, angle2, and angle3 as arguments. Make sure to set these appropriately in the body of theinit_()method. Create a variable named number_of_sides and set it equal to 3. Create a method named check_angles. The sum of a triangle's three angles is It should return True if the sum of self.angle1, self.angle2, and self.angle3 is equal 180, and False otherwise. Create a variable named my_triangle and set it equal to a new instance of your Triangle class. Pass it three angles that sum to 180 (e.g. 90, 30, 60). Print out my_triangle.number_of_sides and print out my_triangle.check_angles ().

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here