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

Animal.noise() returns self.sound.lower(). Make Sheep.noise() return the uppercased version of the instance's sound.

What wrong i am doing here that it is showing my code wrong and every time its saying it looks like Task is no longer passing

sheep.py
from animal import Animal

class Sheep(Animal):
      sound ='bark'
    def noise(self):
        return self.sound.upper()

2 Answers

The indentation is too far. Make sure your indents are 2 or 4 spaces and consistant. Ideally a multiple of 4 in the real world. The Challenge editor accepts 2 spaces, where 2 spaces equals 1 tab.

Hi, Looks like it's all correct except some indenting errors

from animal import Animal

class Sheep(Animal):
  sound ='bark'

  def noise(self):
    return self.sound.upper()