16. Cla$$ It Up


#1



https://www.codecademy.com/courses/python-intermediate-en-WL8e4/3/2?curriculum_id=4f89dab3d788890003000096#

So I'm stuck in here, anyone got a clue what I did wrong?


The Error Message says
Oops, try again. Make sure to pass self as an argument to your check_angles method!


class Triangle(object):
    def __init__(self, angle1, angle2, angle3):
        self.angle1 = angle1
        self.angle2 = angle2
        self.angle3 = angle3
    number_of_sides = 3
    def check_angles(self):
        if sum(self.angle1, self.angle2, self.angle3) == 180:
            return True
        else:
            return False


#2

Also, i couldn't name it "Class It Up" because "class" contains "■■■" :joy:


#3

sum() is a built in function to get the sum of an iterable (for example a list), to just add variable together use +


#4

Thank you :slight_smile: now it works :smiley:


#5