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
Ronnie Barua
17,665 PointsAnimal.noise() returns self.sound.lower(). Make Sheep.noise() return the uppercased version of the instance's sound.
Need help to resolve this one. Thanks in advance. Here is what I did:
from animal import Animal
class Sheep(Animal):
sound = 'aaaaaaaahhhhaaaaa'
pass
def animal_noise(self):
return self.sound()
def sheep_noise(self):
return self.sound.uppercase()
Ronnie Barua
17,665 PointsThanks Jason! I've solved that issue.
Ronnie
5 Answers
Kenneth Love
Treehouse Guest Teacherpass is only meant to be used while the class is empty. Once you put methods into it, take out the pass.
That said, your code isn't passing because you need to make Sheep.noise() respond different, not Sheep.sheep_noise().
Ronnie Barua
17,665 PointsWhat is the syntex for upper case? Is it .upper() or .uppercase? for some odd reason I failed to pass, can u please help me to resolve this. Thanks in advance.
Ronnie Barua
17,665 PointsThanks Kenneth! I was able to solve it just the way you said it above on my own. Thanks a million again.
Ronnie
David Bouchare
9,224 PointsTo answer your second question, it is
.upper()
Indeed.
Ronnie Barua
17,665 PointsThanks David! Unfortunately, .upper() didn't work for me.
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsHi Ronnie,
I went ahead and fixed your code formatting for you.
Please see this thread for how to post code: https://teamtreehouse.com/forum/posting-code-to-the-forum
Which challenge is this for?