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

Animal.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()

Hi 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?

Thanks Jason! I've solved that issue.

Ronnie

5 Answers

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

pass 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().

What 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.

Thanks Kenneth! I was able to solve it just the way you said it above on my own. Thanks a million again.

Ronnie

To answer your second question, it is

.upper() 

Indeed.

Thanks David! Unfortunately, .upper() didn't work for me.