code: def is_leaf(self):
          
          return (not self.data) or \
                 (all(not bool(c) for c, p in self.children))
docs: Returns True if a Node has no subnodes
  
          >>> Node().is_leaf
          True
  
          >>> Node( 1, left=Node(2) ).is_leaf
          False