/**
 * Given a list of tuples containing patient names and their ages,
 * loop through the list and return the sum of ages for all patients.
 *
 * @param ptList A list of tuples, each containing a patient's name (String) and age (Int).
 * @return The sum of ages (Int) for all patients in the list.
 */
fun loopThroughTupList(ptList: List<Pair<String, Int>>): Int {

    // Initialize the accumulator to store the sum of ages
    var totalAge = 0

    // Iterate over each tuple in the list
    for (patient in ptList) {
        // Unpack the patient tuple into name and age variables
        val (name, age) = patient

        // Increment the totalAge by the current patient's age
        totalAge += age
    }

    return totalAge
}
/**
 * Given a list of tuples containing patient names and their ages,
 * loop through the list and return the sum of ages for all patients.
 *
 * @param ptList A list of tuples, each containing a patient's name (String) and age (Int).
 * @return The sum of ages (Int) for all patients in the list.
 */
fun loopThroughTupList(ptList: List<Pair<String, Int>>): Int {
/**
 * Given a list of tuples containing patient names and their ages,
 * loop through the list and return the sum of ages for all patients.
 *
 * @param ptList A list of tuples, each containing a patient's name (String) and age (Int).
 * @return The sum of ages (Int) for all patients in the list.
 */
fun loopThroughTupList(ptList: List<Pair<String, Int>>): Int {

    // Initialize the accumulator to store the sum of ages
    var totalAge = 0

    // Iterate over each tuple in the list
    for (patient in ptList) {
        // Unpack the patient tuple into name and age variables
        val (name, age) = patient

        // Increment the totalAge by the current patient's age
        totalAge += age
    }

    return totalAge
}