Python Object-Oriented Python Inheritance Inheritance Quiz

Albert Egberg
Albert Egberg
7,783 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 59,734 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,783 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 59,734 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,783 Points

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