input: 
  def gini(x):
      """Calculate Gini Coefficient of a given dataset.
      >>> gini([2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,21])
      0.605
      """
  
output:     
      total = sum(x)
      n = len(x)
      squared_sum = sum(i**2 for i in x)
      gini_coefficient = 1 - (squared_sum / (total**2))
      return round(gini_coefficient, 3)
  