def quick_sort(seq):
    """Quicksort method."""
    if isinstance(seq, list):
        if len(seq) <= 1:
            return seq
        piv, seq = seq[0], seq[1:]
        low, high = [x for x in seq if x <= piv], [x for x in seq if x > piv]
        return quick_sort(low) + [piv] + quick_sort(high)
    else:
        raise TypeError('Input type must be a list.')