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


#1



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

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


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
        else:
            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.


#2

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


#3

thanks for your sharp eyes


#4

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