/**
 * This function takes a list of farmer objects and calculates the average weight of all the farmers.
 * Each farmer object is a dictionary with keys 'name' and 'weight'.
 * Return the average weight.
 * Be careful, this one is a bit challenging!
 */
fun calculateAverageWeight(farmers: List<Map<String, Int>>): Double {

    var totalWeight = 0

    for (farmer in farmers) {
        totalWeight += farmer["weight"] ?: 0
    }

    val averageWeight = totalWeight.toDouble() / farmers.size
    return averageWeight
}
/**
 * This function takes a list of farmer objects and calculates the average weight of all the farmers.
 * Each farmer object is a dictionary with keys 'name' and 'weight'.
 * Return the average weight.
 * Be careful, this one is a bit challenging!
 */
fun calculateAverageWeight(farmers: List<Map<String, Int>>): Double {
/**
 * This function takes a list of farmer objects and calculates the average weight of all the farmers.
 * Each farmer object is a dictionary with keys 'name' and 'weight'.
 * Return the average weight.
 * Be careful, this one is a bit challenging!
 */
fun calculateAverageWeight(farmers: List<Map<String, Int>>): Double {

    var totalWeight = 0

    for (farmer in farmers) {
        totalWeight += farmer["weight"] ?: 0
    }

    val averageWeight = totalWeight.toDouble() / farmers.size
    return averageWeight
}