When needing the output of a function such as:
def _hasWon(self):
if self == True
return True
else
return False
Then later setting this via:
self._hasWon(True)
But if I need to check if _hasWon is True later, how would I check it without calling the function?
I currently have:
if self._hasWon(self)
This calls the function again, however, which will change the existing value. How should this be rewritten?