def array(num_elements, element_func, *element_func_args):
    """
    Returns array of elements with a length of num_elements.
    Every element is generated by a call to element_func(*element_func_args).
    """
    return [element_func(*element_func_args) for _ in range(num_elements)]