/**
 * The function takes a list of animals (represented as dictionaries) and calculates the average weight of all the animals.
 *
 * @param animals The list of animals
 * @return The average weight of all the animals
 */
fun calculateAverageWeight(animals: List<Map<String, Any>>): Double {

    var totalWeight = 0.0
    var numAnimals = 0
    for (animal in animals) {
        totalWeight += animal["weight"] as Double
        numAnimals++
    }
    return totalWeight / numAnimals
}
/**
 * The function takes a list of animals (represented as dictionaries) and calculates the average weight of all the animals.
 *
 * @param animals The list of animals
 * @return The average weight of all the animals
 */
fun calculateAverageWeight(animals: List<Map<String, Any>>): Double {
/**
 * The function takes a list of animals (represented as dictionaries) and calculates the average weight of all the animals.
 *
 * @param animals The list of animals
 * @return The average weight of all the animals
 */
fun calculateAverageWeight(animals: List<Map<String, Any>>): Double {

    var totalWeight = 0.0
    var numAnimals = 0
    for (animal in animals) {
        totalWeight += animal["weight"] as Double
        numAnimals++
    }
    return totalWeight / numAnimals
}