-1
class Car():
 def __init__(self,color,model):
  self.color=color
  self.model=model

Audi = Car("red","A4")

print(Audi.color())
print(Audi.model())

I'm getting a "string object is not callable" error. What am I doing wrong?

zondo
  • 19,901
  • 8
  • 44
  • 83
user7083361
  • 33
  • 1
  • 1
  • 6
  • 1
    [what does it mean to call something in python](http://stackoverflow.com/questions/19130958/what-does-it-mean-to-call-a-function-in-python), one does not simply call a string. – Tadhg McDonald-Jensen Oct 28 '16 at 05:02

1 Answers1

2

Remove the parentheses:

print(Audi.color) 
print(Audi.model)

since model and color are simple string attributes of Car rather than callable methods.

elethan
  • 16,408
  • 8
  • 64
  • 87