skbio.tree.TreeNode.has_children

TreeNode.has_children()[source]

Returns True if the node has children.

Returns:

bool

True if the node has children.

See also

is_tip, is_root

Examples

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