Calling class member variables


Hey everyone, I've gotten this far without any issues and can't find my error in the code below. Am I blind? Does anyone else see it? I assume the TypeError means that I haven't properly defined my_car as a member of the Car class.

Traceback (most recent call last):
File "python", line 6, in
TypeError: 'str' object is not callable

class Car(object):

print my_car.condition()


condition is a string not a method so the parentheses are not necessary. Just remove them and it should work.


Thank you! This worked for me.


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