Class it Up Exercise


#1



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


Hi. Could someone help me out?

I keep getting an error code that says

"Oops, try again. Make sure to pass self as an argument to your check_angles method!"

and i don't know why. My code is below.


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

sum() is for an iterable (like a list), to add numbers (variables containing numbers) together, simply use +


#3

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