TypeError: init_animals() takes 1 positional arguments but 2 were given

Posted by libra on Stack Overflow See other posts from Stack Overflow or by libra
Published on 2013-10-19T15:50:09Z Indexed on 2013/10/19 15:53 UTC
Read the original article Hit count: 144

Filed under:
|
|
|
|

I know this title look familiar to some old questions, but i've looked at every single one of them, none of them solves. And here is my codes:

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)

However, i got the following error:

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

Please tell me if i got any mistakes, im so confused by this. Best regards

© Stack Overflow or respective owner

Related posts about python

Related posts about class