# build your own append
from functools import reduce

def concat(L: list) -> list:
    """concatenate list of one or more lists into one list

    >>> concat([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
    [1, 2, 3, 4, 5, 6, 7, 8, 9]
    """
    return reduce(list.__add__, L, [])

def prod(L: list) -> int:
    """
    product of a list of numbers, default 1

    >>> prod([])
    1
    >>> prod([1, 2, 3])
    6
    """
    return reduce(int.__mul__, L, 1)

def nested_prod(L: list) -> int:
    """
    product of numbers in possibly nested list of ints

    >>> nested_prod([1, 2, 3])
    6
    >>> nested_prod([1, [2, [3, 4]], 5])
    120
    """
    return prod([nested_prod(x) if isinstance(x, list) else x for x in L])

def big_union(L: 'list of sets') -> set:
    """union of all sets in L, empty set if there are none.

    >>> big_union([])
    set()
    >>> big_union([{1, 2, 3}, {1, 2, 4}, {2, 4, 7}]) == {1, 2, 3, 4, 7}
    True
    """
    return reduce(set.union, L, set())

## Note, this is not a reduce function!

def value_count(L: list) -> int:
    """number of non-list elements in possibly-nested L

    >>> value_count([])
    0
    >>> value_count([1, "five", True])
    3
    >>> value_count([1, ["five", True, [False, "seven"]], 9])
    6
    """
    return sum([value_count(x) if isinstance(x, list) else 1 for x in L])


if __name__ == '__main__':
    import doctest
    doctest.testmod()