code: def distance(x,y):
      
      assert len(x) == len(y), "The vector must have same length"
      result = ()
      sum = 0
      for i in range(len(x)):
          result += (x[i] -y[i],)
      for component in result:
          sum += component**2
      return math.sqrt(sum)
docs: [summary]
      HELPER-FUNCTION
      calculates the (eulidean) distance between vector x and y.
  
      Arguments:
          x {[tuple]} -- [vector]
          y {[tuple]} -- [vector]