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 Object-Oriented Python (retired) Inheritance Override Inherited Methods

I'm having trouble understanding how to change the Sheep.noise() to an uppercase version of sound.

from animal import Animal

class Sheep(Animal): sound = 'baaa' Sheep.noise = sound.upper()

4 Answers

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

You need to write a new noise method for your class.

Hi Chris, Where did you get .noise from? If it from import animal what code is in animal.py?

That's a good question, Gloria. I have no idea. It is just the exercise question. It says "Animal.noise is returned as self.sound.lower() how can you return Sheep.noise as all upper case with the value passed?" ... I may have worded it a little wrong, but those are the terms it gives me.


Thank you Kenneth. I totally missed that for some reason. Literally face pounded my desk when I figured it out. :P