Class It Up: Assignment can be passed while incomplete


#1




The level completes with a minimal code that describes the triangle class. The check angles method does not have to be there to pass the level. Also in next levels you can ignore the times where you have to use check angles method.


I should not pass this level because I did not write the check angles method


#THIS PASSES THE LEVEL
class Triangle(object):
    number_of_sides = 3
    def __init__(self, angle1, angle2, angle3):
        self.angle1 = angle1
        self.angle2 = angle2
        self.angle3 = angle3

###THIS SHOULD BE REQUIRED TO PASS:
class Triangle(object):
    number_of_sides = 3
    def __init__(self, angle1, angle2, angle3):
        self.angle1 = angle1
        self.angle2 = angle2
        self.angle3 = angle3
        
    def check_angles(self):
        if self.angle1 + self.angle2 + self.angle3 == 180:
            return True
        else:
            return False


#2

Hi, @bitcoinminer ,

Thanks for noticing this. It is a bug in Codecademy's submission correctness test (SCT) test for this exercise.

Since Codecademy plans to replace the current Python track with new content early next year, this bug will probably not get fixed in the existing exercise.

EDIT: (December 19, 2016):

As you reported, if you do not define check_angles at all, Codecademy lets you pass, provided that it does not first find another problem. However, if you define check_angles as something other than a method in your definition of Triangle, Codecademy catches the problem ...

check_angles = "I am a str, but should be a method."

Codecademy's response ...


#3

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