def all_same(v, array):
    """
    Checks whether all elements in an array ar equal to a given value

    Parameters
    ----------
    v: scalar
        The value to be checked against
    array: list[]
        The array to be checked

    Returns
    -------
    bool
        True if all elements in the array are equal to the given one

    """
    return all(x == v for x in array) and len(array) > 0
    # Solution 2:
    #
    # array.count(v) == len(array) and len(array) > 0

    # Solution 3:
    #
    # for x in array:
    #     if x != v:
    #         return False
    # return True