Skip to Content
Introduction to Classes
Class It Up

Great! Now let’s add a member variable and a method to our class.



Inside the Triangle class:

  • 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 should return True if the sum of self.angle1, self.angle2, and self.angle3 is equal 180, and False otherwise.
Folder Icon

Take this course for free

Already have an account?