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

8th Mar 2018, 12:24 PM
genios__
genios__ - avatar
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
8th Mar 2018, 1:18 PM
Dinesh Banjara
Dinesh Banjara - avatar