input: Write a function to calculate the means of two classes.
  assert calculate_means([['men', 'sports', 1], ['women', 'foods', 0], ['men', 'foods', 1], ['women', 'sports', 0]]) == [0.5, 0.5]
  assert calculate_means([['men', 'sports', 0], ['women', 'foods', 0], ['men', 'foods', 1], ['women', 'sports', 1]]) == [0.5, 0.5]
  assert calculate_means([['men', 'sports', 0], ['women', 'foods', 0], ['men', 'foods', 0], ['women', 'sports', 0]]) == [1.0, 0.0]
output: def calculate_means(data):
      men_count = 0
      women_count = 0
      men_sum = 0
      women_sum = 0
      
      for record in data:
          if record[0] == 'men':
              men_count += 1
              men_sum += record[2]
          elif record[0] == 'women':
              women_count += 1
              women_sum += record[2]
      
      men_mean = men_sum / men_count if men_count != 0 else 0
      women_mean = women_sum / women_count if women_count != 0 else 0
      
      return [men_mean, women_mean]