Instantiate an object


#1


https://www.codecademy.com/en/courses/python-intermediate-en-WL8e4/3/3

attribute eeror


class Triangle():
    def __init__(self,angle1,angle2,angle3):
        angle1=self.angle1
        angle2=self.angle2
        angle3=self.angle3
       
    number_of_sides=3
    def check_angles(self):
        if self.angle1+self.angle2+self.angle3==180:
            return True
           # print "lol"
        else:
            return False

my_triangle=Triangle(90,45,45)
print my_triangle.number_of_sides
print my_triangle.check_angles()


#2

The error message at right seems to point at the area of concern.

attributeError: Triangle instance has no attribute 'angle1'

Be sure the left side and right side of the assignments are as expected.


#4

mtf and OP,

I have the same issue. mtf, left and right side are as expected and in my judgement correct.

The lesson seems to get very buggy after lesson 15.

I'm beyond frustrated

-Chris


#5

@tagslayer77837, please post your code so we can test it. Thank you.