+ 14

What are the "Max" and "gray" cases? When I add the "black" code shows an error!?

https://code.sololearn.com/cgICUf72E39w/?ref=app

15th Mar 2018, 11:41 PM
Vučko/ВучĐșĐŸ/Vuchko
Vučko/ВучĐșĐŸ/Vuchko - avatar
2 Answers
+ 3
You have an error because your constructor only takes two arguments: name and color. You are passing it 3 arguments when you add "black". The self keyword as "argument" in the contructor just refers to the current object. Note that though the method bark was defined this way: bark(self) you called it with no argument: bark(). If you tried to call bark with an argument you will have an error as well.
16th Mar 2018, 12:13 AM
cyk
cyk - avatar
+ 1
You are passing Three arguements insted of two. If You will pass only one color of your Dog class. This will compile.
20th Mar 2018, 7:26 AM
Amit Tiwari