Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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