Determine the monotony of a sequence

    :param seq: a sequence

    :returns: 1 if the sequence is sorted (increasing)
    :returns: 0 if it is not sorted
    :returns: -1 if it is sorted in reverse order (decreasing)

    >>> monotony([1, 2, 3])
    1
    >>> monotony([1, 3, 2])
    0
    >>> monotony([3, 2, 1])
    -1

def monotony(seq):
    """Determine the monotony of a sequence

    :param seq: a sequence

    :returns: 1 if the sequence is sorted (increasing)
    :returns: 0 if it is not sorted
    :returns: -1 if it is sorted in reverse order (decreasing)

    >>> monotony([1, 2, 3])
    1
    >>> monotony([1, 3, 2])
    0
    >>> monotony([3, 2, 1])
    -1

    """
    if seq == sorted(seq):
        return 1
    elif seq == list(reversed(sorted(seq))):
        return -1
    else:
        return 0