Traceback (most recent call last):
File "python", line 13, in
File "python", line 3, in init
AttributeError: 'Triangle' object has no attribute 'angle1'
Hi, I've tried different ways that I was hoping to fix it such as adding self.angle instead of angle, and putting self before 90 in my_triangle. Anyway, can't figure it out.
Replace this line with your code. class Triangle(object): def __init__(self, angle1, angle2, angle3): angle1 = self.angle1 angle2 = self.angle2 angle3 = self.angle3 number_of_sides = 3 def check_angles(): if angle1 + angle2 + angle3 == 180: return True else: return False my_triangle = Triangle(90, 30, 60) print my_triangle.number_of_sides print my_triangle.check_angles()