Question
Why do I get an error when running my code for “Overriding Methods”?
Answer
Some common issues here include:
- Incorrectly indenting your code inside of your class, or indenting the
print
statements andmy_car.drive_car()
statement that should be completely unindented at the end of your code - Accessing the
condition
of your car incorrectly; recall that we can access a variable of an object like this:my_car.variable_name
- Not
print
ing each step as asked by the instructions; the instructions want us toprint
the car’scondition
, then use thedrive_car()
method, and thenprint
thecondition
again to see the change