/**
 * Calculates the average age of a list of artists.
 * The age values are floating-point numbers.
 * Each artist in the list is a dictionary with 'name' and 'age' keys.
 *
 * @param artists The list of artists.
 * @return The average age of the artists, rounded to 2 decimal places.
 */
fun calculateAverageAge(artists: List<Map<String, Any>>): Double {

    var totalAge = 0.0
    var numArtists = 0

    for (artist in artists) {
        totalAge += artist["age"] as Double
        numArtists++
    }

    val averageAge = totalAge / numArtists

    // Round the average age to 2 decimal places
    // and return the result
    return String.format("%.2f", averageAge).toDouble()
}
/**
 * Calculates the average age of a list of artists.
 * The age values are floating-point numbers.
 * Each artist in the list is a dictionary with 'name' and 'age' keys.
 *
 * @param artists The list of artists.
 * @return The average age of the artists, rounded to 2 decimal places.
 */
fun calculateAverageAge(artists: List<Map<String, Any>>): Double {
/**
 * Calculates the average age of a list of artists.
 * The age values are floating-point numbers.
 * Each artist in the list is a dictionary with 'name' and 'age' keys.
 *
 * @param artists The list of artists.
 * @return The average age of the artists, rounded to 2 decimal places.
 */
fun calculateAverageAge(artists: List<Map<String, Any>>): Double {

    var totalAge = 0.0
    var numArtists = 0

    for (artist in artists) {
        totalAge += artist["age"] as Double
        numArtists++
    }

    val averageAge = totalAge / numArtists

    // Round the average age to 2 decimal places
    // and return the result
    return String.format("%.2f", averageAge).toDouble()
}