unit4_pp/scripts/unit4_exercise.py
def calculate_distance(p1, p2):
  """
  Calculates distance between two [x,y] coordinates.
  p1: the point (as list containing x and y values) from which to measure 
  p2: the point (as list containing x and y values) to which to measure
  returns: the distance
  """
  dx = p2[0] - p1[0]
  dy = p2[1] - p1[1]
  distance = (dx ** 2 + dy ** 2)**0.5
  return distance

  Calculates distance between two [x,y] coordinates.
  p1: the point (as list containing x and y values) from which to measure 
  p2: the point (as list containing x and y values) to which to measure
  returns: the distance
  
Calculates distance between two [x,y] coordinates.
p1: the point (as list containing x and y values) from which to measure
p2: the point (as list containing x and y values) to which to measure
returns: the distance
Calculates distance between two [ x y ] coordinates . p1 : the point ( as list containing x and y values ) from which to measure p2 : the point ( as list containing x and y values ) to which to measure returns : the distance
def calculate_distance(p1, p2):
  dx = p2[0] - p1[0]
  dy = p2[1] - p1[1]
  distance = (dx ** 2 + dy ** 2)**0.5
  return distance
def calculate_distance ( p1 , p2 ) : dx = p2 [ 0 ] - p1 [ 0 ] dy = p2 [ 1 ] - p1 [ 1 ] distance = ( dx ** 2 + dy ** 2 ) ** 0.5 return distance
Calculates distance between two [x,y] coordinates.
Calculates distance between two [ x y ] coordinates .
"""
  Calculates distance between two [x,y] coordinates.
  p1: the point (as list containing x and y values) from which to measure 
  p2: the point (as list containing x and y values) to which to measure
  returns: the distance
  """
p1
p2