(self)
return self.parent.level + 1 if self.parent is not None else 0
Tracks how deeply nested this state is. This property is calculated from
            the state's parent (+1) or 0 when there is no parent.
Tracks how deeply nested this state is. This property is calculated from
            the state's parent (+1) or 0 when there is no parent.
Tracks how deeply nested this state is . This property is calculated from the state s parent ( + 1 ) or 0 when there is no parent .
def level(self):
        """ Tracks how deeply nested this state is. This property is calculated from
            the state's parent (+1) or 0 when there is no parent. """
        return self.parent.level + 1 if self.parent is not None else 0
def level ( self ) : return self . parent . level + 1 if self . parent is not None else 0