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 trialJason Kanjiravilyil
1,339 PointsUnable to add arguments __init__
Using your Panda class, add two arguments to your class in the init method called name and age. Set the values inside of the init method using self.
I keep getting an assertion error when attempting to add arguments the init method.
class Panda:
species = 'Ailuropoda melanoleuca'
food = 'bamboo'
def __init__(self, name, age):
self.is_hungry = True
self.name = 'Jason'
self.age = 32
1 Answer
Mel Rumsey
Treehouse ModeratorHey Jason Kanjiravilyil This challenge is asking you to pass in the value of the names passed into it. So when the function is called, the name and age will be passed in as arguments. So for this challenge you can set self.name equal to name and self.age equal to age.
Hope this helps :D