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

stage 2 inheritance

Make a new class named Sheep that inherits from Animal. The Animal class is in animal.py. Remember, you can use pass to make empty classes.


3 Answers

class Sheep(Animal): Animal_class = "sheep", pass

im getting errors where im i wrong guys im stuck

Eleeza Amin
Eleeza Amin
34,496 Points

Could you use Markdown Cheatsheet for code? It's easier to understand.

Albert Lam
Albert Lam
Courses Plus Student 6,317 Points

that was weird, when I finally decided to put something inside the class it actually let me pass. lol

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

You have to import Animal from animal.py.

This was very difficult to figure out Task One

from animal import Animal class Sheep(Animal):