/**
 * Geographically calculate the average temperature using a basic loop syntax and creating a tuple using the tuple() function.
 */
fun calculateAverageTemperature(temperatureData: List<Triple<Double, Double, Double>>): Double {

    // Step 1: Initialize the sum of temperatures to 0
    var temperatureSum = 0.0

    // Step 2: Iterate through the temperature data
    for (temperature in temperatureData) {
        // Step 3: Extract the latitude and longitude from the temperature tuple
        val (_, _, temp) = temperature

        // Step 4: Add the temperature value to the sum
        temperatureSum += temp
    }

    // Step 5: Calculate the average temperature by dividing the sum by the number of data points
    val averageTemperature = temperatureSum / temperatureData.size

    return averageTemperature
}
/**
 * Geographically calculate the average temperature using a basic loop syntax and creating a tuple using the tuple() function.
 */
fun calculateAverageTemperature(temperatureData: List<Triple<Double, Double, Double>>): Double {
/**
 * Geographically calculate the average temperature using a basic loop syntax and creating a tuple using the tuple() function.
 */
fun calculateAverageTemperature(temperatureData: List<Triple<Double, Double, Double>>): Double {

    // Step 1: Initialize the sum of temperatures to 0
    var temperatureSum = 0.0

    // Step 2: Iterate through the temperature data
    for (temperature in temperatureData) {
        // Step 3: Extract the latitude and longitude from the temperature tuple
        val (_, _, temp) = temperature

        // Step 4: Add the temperature value to the sum
        temperatureSum += temp
    }

    // Step 5: Calculate the average temperature by dividing the sum by the number of data points
    val averageTemperature = temperatureSum / temperatureData.size

    return averageTemperature
}