def slope(x_val, y_val):
  """
  This function returns the slope of a line segment.

  Parameters
  ----------
  x_val, y_vals : coordinates of the two points of the line segments(x_val = [x1, x2], y_val = [y1, y2]).

  Return
  ----------
  slope of line segment.
  
  """
  return ((y_val[1]-y_val[0])/(x_val[1]-x_val[0]))