Whats problem? My code or my browser? 18.Inheritance


I think i've done everything right. Is there a problem with my browser or does my code causes it?


Traceback (most recent call last):
File "python/cli_runner.py", line 152, in

class Triangle(object):
    def __init__(self,angle1,angle2,angle3):
        self.angle1 = angle1
        self.angle2 = angle2
        self.angle3 = angle3
    number_of_sides = 3
    def check_angle(self):
        if self.angle1+self.angle2+self.angle3 == 180:
            return True
            return False
my_triangle = Triangle(15,75,90)

print my_triangle.number_of_sides
print my_triangle.check_angle()

class Eqıilateral(Triangle):
    angle = 60
    def __init__(self):
        self.angle1 = self.angle
        self.angle2 = self.angle
        self.angle3 = self.angleReplace this line with your code.


Hi first this line

def check_angle(self):

your methiod should name check_angles the same here

print my_triangle.check_angle()

then this line

class Eqıilateral(Triangle):

you wrote Eqıilateral instead of Equilateral you put ı instaed of u


thanks for your sharp eyes


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