Calling class member variables


#1



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.

https://www.codecademy.com/courses/python-intermediate-en-egNXj/0/4?curriculum_id=4f89dab3d788890003000096

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


class Car(object):
    condition='new'
    

my_car=Car()
print my_car.condition()


#2

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


#3

Thank you! This worked for me.


#4

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