Python Basic Object-Oriented Python Welcome to OOP Creating a Panda Class

Anthony Costanza
Anthony Costanza
2,123 Points

Not really sure why I'm failing

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’. Bummer: AssertionError: 'class Panda' not found in '# insert your code here\n\nClass Panda:\n \n def intit(self, species, food):\n self.species = species\n = food\n \npanda_one = Panda()\npanda_two = Panda()' : Creating a class should start with the class keyword and then the name of your class, Panda. RestartGet HelpCheck Work


insert your code here

2 ​ 3 Class Panda: 4

5 def intit(self, species, food): 6 self.species = species 7 = food 8

9 panda_one = Panda() 10 panda_two = Panda() 11
# insert your code here

Class Panda:

    def __intit__(self, species, food):
        self.species = species = food

panda_one  = Panda()
panda_two = Panda()

2 Answers

Hi Anthony!

This passes both tasks:

# insert your code here
class Panda:
    species = 'Ailuropoda melanoleuca'
    food = 'bamboo'

    def __init__(self):
        self.is_hungry = True

I hope that helps.

Stay safe and happy coding!