def is_tree(tree):
    'Returns True if the given tree is a tree, and False otherwise.'
    if ((type(tree) != list) or (len(tree) < 1)):
        return False
    for branch in branches(tree):
        if (not is_tree(branch)):
            return False
    return True
Returns True if the given tree is a tree, and False otherwise.
def is_tree(tree):
    
    if ((type(tree) != list) or (len(tree) < 1)):
        return False
    for branch in branches(tree):
        if (not is_tree(branch)):
            return False
    return True