Class it up


It says:
Oops, try again. It looks like your check_angles method doesn't return True for valid triangle angle values.

Could you guys please tell me where am I wrong?

class Triangle(object):
    """Make Triangles!"""
    def __init__(self, angle1 ,angle2 ,angle3):
        Triangle.angle1 = angle1
        Triangle.angle2 = angle2
        Triangle.angle3 = angle3
    def check_angles(self):
        if (self.angle1+self.angle2+self.angle3 == 180):
            return True
            return False
    number_of_sides = 3
T = Triangle(25,25,130)
print T.check_angles()


the problem is in __init__(), could you explain your thinking about this line:

Triangle.angle1 = angle1


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.