16 Class it up. Utterly confused


#1

class Triange(object):
number_of_sides = 3

def __init__(self, angle1, angle2, angle3):
    angle1.self = angle1
    angle2.self = angle2
    angle3.self = angle3

def check_angles(self):
    if self.angle1+self.angle2+self.angle3 == 180:
        return True
    else:
        return False

Not sure what I did wrong here. It keeps repeating I didn't set the variable number_of_sides . . but I clearly did!?

What did I do wrong??


#2

on line 2 use the TAB (variable)


#3

Cleaned up:

class Triangle(object):
(1 indent)def init(self, angle1, angle2, angle3):
(2 indent)self.angle1 = angle1
(2 indent)self.angle2 = angle2
(2 indent)self.angle3 = angle3
(1 indent)number_of_sides = 3
(1 indent)def check_angles(self):
(2 indent)return self.angle1 + self.angle2 + self.angle3 == 180