Hi im having trouble,Im new to coding and learning python from a book.but im stuck on this part


#1

so heres the code

class animal: 
        def _init_(self, species,number_of_legs,color) 
              species.self = species 
              self .number_of_legs  = number_of_legs 
              self.color = color 

harry = animal(hippo,4,gray)

and it keeps displaying the same error message:

File “<pyshell#7>”, line 1, in
harry = Animal(‘hippo’,4,‘pink’)
TypeError: object() takes no parameters


#2

the __init__() method should have 4 underscores, 2 on each side of the init word two underscores

without enough underscores, the method isn’t recognized

the init method gets called when you create an instance, which is why you get an error when creating an instance. There is no init method (because its faulty named), so python doesn’t know what to do with the arguments you supply when creating an instance


#3

Thank you ! Very much.


#4