/**
 * This function takes a list of dictionaries containing information about different animals. Each animal dictionary
 * contains the keys 'name' (string), 'weight' (float), and 'species' (string). The function calculates and returns the
 * average weight of all the animals in the list.
 */
fun calculateAverageWeight(animalsData: List<Map<String, Any>>): Double {

    var totalWeight = 0.0
    var count = 0

    for (animal in animalsData) {
        totalWeight += animal["weight"] as Double
        count++
    }

    val averageWeight = totalWeight / count

    return averageWeight
}
/**
 * This function takes a list of dictionaries containing information about different animals. Each animal dictionary
 * contains the keys 'name' (string), 'weight' (float), and 'species' (string). The function calculates and returns the
 * average weight of all the animals in the list.
 */
fun calculateAverageWeight(animalsData: List<Map<String, Any>>): Double {
/**
 * This function takes a list of dictionaries containing information about different animals. Each animal dictionary
 * contains the keys 'name' (string), 'weight' (float), and 'species' (string). The function calculates and returns the
 * average weight of all the animals in the list.
 */
fun calculateAverageWeight(animalsData: List<Map<String, Any>>): Double {

    var totalWeight = 0.0
    var count = 0

    for (animal in animalsData) {
        totalWeight += animal["weight"] as Double
        count++
    }

    val averageWeight = totalWeight / count

    return averageWeight
}