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 Inheritance Inheritance Quiz

Albert Egberg
Albert Egberg
7,786 Points

I don't seem to understand this question. Why wouldnt it return True?

I mean has_pulp = True so why whouldnt Orange().squeeze().has_pulp() return true?

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,441 Points

Good question. The quiz states: Orange().squeeze() will return True

The reference to the class attribute has_pulp would be self.has_pulp.

In the context of the quiz, the reference to has_pulp is undefined and would raise an error

Edited quiz text

Post back if you need more help. Good luck!!!

Albert Egberg
Albert Egberg
7,786 Points

Yea, that's what I thought aswell, but like you said, it would raise an error. Why does it return False then?

Chris Freeman
Chris Freeman
Treehouse Moderator 68,441 Points

Correcting my answer about. The quiz states the reference will return True, but due to the error raised this statement is not true => False.

Albert Egberg
Albert Egberg
7,786 Points

Okey, I will look more into this. Thanks for the help! :)