input: Write a function to optimize the given objective function using the scipy.optimize.minimize function with the Nelder-Mead method. The objective function should be defined within the function obj_func, and the optimization should start from an initial guess x0 = [0.0, 0.0, 0.0]. The function should return the optimized values of the variables.
  
  def obj_func(x):
      # objective function
      return (x[0] - 1)**2 + (x[1] - 2.5)**2 + (x[2] - 3.5)**2
  
  def optimize(): 
      # set up optimization problem
      x0 = [0.0, 0.0, 0.0] 
      res = minimize(obj_func, x0, method='nelder-mead', options={'xtol': 1e-8, 'disp': True}) 
      return res.x
  
  assert list(optimize())==[1.0, 2.5, 3.5]
output: def optimize(): 
      x0 = [0.0, 0.0, 0.0] 
      res = minimize(obj_func, x0, method='nelder-mead', options={'xtol': 1e-8, 'disp': True}) 
      return res.x