input: Write a function to perform gradient descent for linear regression.
  assert gradient_descent([1, 2, 3, 4], [2, 4, 6, 8], iters=1000, lr=0.01) == (2.0, 0.0)
  assert gradient_descent([1, 2, 3], [1, 2, 3], iters=1000, lr=0.01) == (1.0, 0.0)
  assert gradient_descent([1, 2, 3, 4, 5], [1, 3, 5, 7, 9], iters=1000, lr=0.01) == (2.0, -1.0)
output: def gradient_descent(x, y, iters, lr):
      m, b = 0.0, 0.0
      n = len(x)
      
      for _ in range(iters):
          y_pred = [m * xi + b for xi in x]
          D_m = (-2/n) * sum(xi * (yi - y_hat) for xi, yi, y_hat in zip(x, y, y_pred))
          D_b = (-2/n) * sum(yi - y_hat for yi, y_hat in zip(y, y_pred))
          m -= lr * D_m
          b -= lr * D_b
          
      return m, b