You need to add self
as the first argument of init_animals
:
def init_animals(self, y):
pass
self
(similar to this
in Java) is the instance of the class. Every time you call a method within the class, self
is sent to that method as the first argument.