skbio.tree.TreeNode.has_children#

TreeNode.has_children()[source]#

Check if the current node has any children.

Returns:
bool

Whether the node has at least one child.

See also

is_tip
is_root

Examples

>>> from skbio import TreeNode
>>> tree = TreeNode.read(["((a,b)c);"])
>>> print(tree.has_children())
True
>>> print(tree.find('a').has_children())
False