input: def is_monotonic(seq: list):
      """Determine if the elements of the list are either non-increasing or non-decreasing.
      >>> is_monotonic([1, 2, 4, 20])
      True
      >>> is_monotonic([1, 20, 4, 10])
      False
      >>> is_monotonic([4, 1, 0, -10])
      True
      """
output:     
      return all(seq[i] <= seq[i + 1] for i in range(len(seq) - 1)) or all(seq[i] >= seq[i + 1] for i in range(len(seq) - 1))
  