调用类函数报错:TypeError: set_number_served() takes 1 positional argument but 2 were given
在已有的类的基础上,追加了一个属性及其修改方法。
方法如下:
def set_number_served(num):
self.number_served = num
在实例化的程序调用时,报错:
TypeError: set_number_served() takes 1 positional argument but 2 were given
刚开始以为是...
原创
2018-09-10 11:11:42 ·
1322 阅读 ·
0 评论