I think this is a bug


I did an exercise on classes and i noticed something, don't know if it's a bug but i think so, does the interpreter only function properly when i correctly code what is expected. This is a code with a logical error sel.mpg = mpg but i still passed the lesson, one question "Is the interpreter designed for lesson "errors" only?", errors we're expected to make. I also removed the last "n" in my_car.condition, still passed the lesson.

class Car(object):
    condition = "new"
    def __init__(self, model, colour, mpg):
        self.model = model
        self.colour = colour
        sel.mpg = mpg

my_car = Car("DeLorean", "silver", 88)
print my_car.condition


there are two things at play here:

python interpreter. Which will give syntax errors
Codecademy exercise validation, which only validate what you need to code in that specific lesson



Ibiam Chihurumnaya


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