Please give me correct sentence


#1

class Shape(object):
"""Makes shapes!"""
def init(self, number_of_sides):
self.number_of_sides = number_of_sides
Triangle = Shape(3)

class Triangle(Shape):
number_of_sides = 3
def init(self, sidel, side2, side3):
self.side1 = side1
self.side2 = side2
self.side3 = side3

i have same problem
please give me correct sentence


12. inheritance syntax
#2

@songkukyoung The way you wrote your code is what was givng yu the errors maybe you should do a refresher on Control Flow in python, but here is working inheritance code. Take a look and see if you understand what's going on

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 self.angle1 + self.angle2 + self.angle3 == 180:
            return True
        else:
            return False
class Equilateral(Triangle):
    def __init__(self):
        self.angle1 = self.angle
        self.angle2 = self.angle
        self.angle3 = self.angle
    angle = 60
my_triangle = Triangle(90, 30, 60)
print my_triangle.number_of_sides
print my_triangle.check_angles()

#3

That worked! Thanks for the help Barry!