【发布时间】:2013-10-28 09:01:37
【问题描述】:
我知道这个标题对于一些老问题来说看起来很熟悉,但我已经查看了每一个问题,但没有一个能解决。 这是我的代码:
class Island (object):E,W,R,P
def __init__(self, x, y):
self.init_animals(y)
def init_animals(y):
pass
isle = Island(x,y)
但是,我收到以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 3, in __init__
TypeError: init_animals() takes 1 positional arguments but 2 were given
如果我有任何错误,请告诉我,我对此感到很困惑。 最好的问候
【问题讨论】:
-
def init_animals(self, y):
标签: python class methods typeerror init