docs: def lookup_discrete(x, xs, ys):
      """
      Intermediate values take on the value associated with the next lower x-coordinate (also called a step-wise function). The last two points of a discrete graphical function must have the same y value.
      Out-of-range values are the same as the closest endpoint (i.e, no extrapolation is performed).
      """
      for index in range(0, len(xs)):
          if x < xs[index]:
              return ys[index - 1] if index > 0 else ys[index]
      return ys[len(ys) - 1]