0
help me
why output error in my code : Traceback (most recent call last): File "restoran.py", line 33, in <module> NAME.number_served() TypeError: 'int' object is not callable https://code.sololearn.com/ccloBe8P351m/#py
1 Answer
+ 1
in your code, type (NAME.number_served) = 'class 'int' '
it means number_served is not a Method, it is a class variable... So don't put parentheses, [NAME number_served()]
if you want number_served to be a method then change name of self.number_served.. You can write self.numberServed
def number_served(self, number):
self.numberServed = number
return self.numberServed