Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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

Create a class called Panda. Inside your class, create two class attributes. One called species set to ‘Ailuropoda melan

dont understand what it is trying to ask

panda.py
# insert your code here
class Panda() :
    pass

    def ___inti__(self,species,food):
       self.species= Ailuropoda melanoleuca
       self.food='bamboo'

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,457 Points

Hey NAVEEN NAHAR, you’re not far off. What you have created are instance attributes since they were created in the __init__ method.

The challenge is asking for class attributes. These are created without using self. and are coded where the pass statement is located.

Post back if you need more help. Good luck!!!

Laura Mora Freeman
Laura Mora Freeman
8,192 Points

You can set your class attributes with the name of the attribute, an = and the value you want to pass. Ex. color = 'red'