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 trialMario Paoli
1,426 PointsI can not get the class Panda to work...
I have been trying this for half an hour now and I cant get it to work, I need help.
class Panda:
def __init__(self, species='Ailuropoda melanoleuca', food= 'bamboo') :
self.species = species
self.food= food
1 Answer
boi
14,242 PointsYou've given keyword arguments to the __init__
method. You're supposed to set the attributes inside the class block. Try to makes this change, if the problem persists, let me know.
Mario Paoli
1,426 PointsI was overthinking by a ton, I just reviewed the video and tried to find a simpler solution a and it worked thank you.
Mario Paoli
1,426 PointsMario Paoli
1,426 PointsCreate 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โ. These are the instructions.