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 Basic Object-Oriented Python Creating a Memory Game Class Review

If "falling_leaves" starts as False, wouldn't "if not self.falling_leaves" equate to "if self.falling_leaves = True"?

I do not understand why this program would change falling_leaves to True when the condition asks "if not self.falling_leaves"... Doesn't this mean if self.falling_leaves is not false, because of the not and the original condition of falling_leaves being false?

1 Answer

Travis Alstrand
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Travis Alstrand
Treehouse Project Reviewer

Hey Charles Blackburn ! :wave:

I had to really stare at this quiz question for a while as well to understand why it was made this way. It's, as you mentioned, going to always return True given the code used.

I believe though that this is a way for the user to kind of "activate" (set) a "fall" (autumn) state if that makes sense. Not necessarily a "getter" for the "fall" state.