Why aren’t my car’s values being printed out when I Run my code?


#1

Question

Why aren’t my car’s values being printed out when I Run my code?

Answer

If you’re seeing errors or no values being displayed when you Run your code, it’s likely an indentation or syntax issue. Be sure to completely unindent the code you write for the “Referring to Member Variables” exercise, otherwise it’ll be considered part of the class Car code block.
Also, be sure not to assign your instance variables backwards like this: var_name = self.var_name. They should always look like this: self.var_name = var_name.


FAQ: Learn Python - Classes - Referring to member variables