Error Message Includes :
Oops, try again. In your check_angles method, make sure to check the sum of self.angle1 + self.angle2 + self.angle3.
I would like an explanation regarding self as argument in my code, I thought this code would work. As per the hint, I am supposed to replace the Triangle argument in def check_angles() method by self as an argument.
I would really love an explanation that would be as simple as possible..
Also, Please can anybody explain inheritance? I still feel I haven't understood the concept well enough!
Thank you in advance!
"""Creating a Parent Class called Triangle and initializing the class using __init__()""" class Triangle(object): def __init__(self, angle1, angle2, angle3): self.angle1 = angle1 self.angle2 = angle2 self.angle3 = angle3 #Initializing the member variable inside Triangle Class. number_of_sides = 3 def check_angles(Triangle): if self.angle1+self.angle2+self.angle3 == 180 : return True else : return False