input: Write a function to calculate the Gini coefficient from a list of data.
  assert round(gini([1, 2, 3, 4, 5]), 2) == 0.27
  assert round(gini([10, 20, 30, 40, 50]), 2) == 0.27
  assert round(gini([1, 1, 1, 1, 1]), 2) == 0.00
output: def gini(data):
      data = sorted(data)
      n = len(data)
      cumulative_sum = 0
      for i, value in enumerate(data):
          cumulative_sum += (i + 1) * value
      gini_coefficient = (2 * cumulative_sum) / (n * sum(data)) - (n + 1) / n
      return gini_coefficient