Learn
Introduction to Classes
Class It Up
Great! Now let’s add a member variable and a method to our class.
Instructions
1.
Inside the Triangle
class:
- Create a variable named
number_of_sides
and set it equal to3
. - Create a method named
check_angles
. The sum of a triangle’s three angles should returnTrue
if the sum ofself.angle1
,self.angle2
, andself.angle3
is equal180
, andFalse
otherwise.