Andy McDonald2,767 Points
Dont know how to make an attribute to an __init__ method while only passing the self argument.
Problem asks: Create a class called Panda. Inside your class, create two class attributes. One called species set to ‘Ailuropoda melanoleuca’ and another called food set to ‘bamboo’. The best I can do: class Panda: species = 'Ailuropoda melanoleuca' food = 'bamboo'
def __init__(self, is_hungry=True): self.is_hungry = is_hungry
fat_panda = Panda()
Error says that 1 != 2. Can only pass the self argument. Pretty sure I have not been taught to do that yet...
# insert your code here class Panda: species = 'Ailuropoda melanoleuca' food = 'bamboo' def __init__(self, is_hungry=True): self.is_hungry = is_hungry fat_panda = Panda()
Chris FreemanTreehouse Moderator 65,196 Points
You are so close. The task does not ask for any
__init___ parameters. It wants you to hard code the value to
self.is_hungry = True
Now the extra parameter can be removed.
As for passing an argument to
__init__, your syntax would be correct.
Post back if you need more help. Good luck!!!