/**
 * The function takes a list of tuples as input and performs indexing and slicing on the tuples.
 * It also demonstrates loop control using the index of the tuples.
 *
 * @param tuples A list of tuples.
 * @return The sum of the second elements from the tuples that have an odd index.
 */
fun indexingAndSlicingTuplesLoopControl(tuples: List<Pair<Int, Int>>): Int {

    var result = 0
    for ((index, tup) in tuples.withIndex()) {
        if (index % 2 != 0) { // skip even index tuples
            result += tup.second
        }
    }
    return result
}
/**
 * The function takes a list of tuples as input and performs indexing and slicing on the tuples.
 * It also demonstrates loop control using the index of the tuples.
 *
 * @param tuples A list of tuples.
 * @return The sum of the second elements from the tuples that have an odd index.
 */
fun indexingAndSlicingTuplesLoopControl(tuples: List<Pair<Int, Int>>): Int {
/**
 * The function takes a list of tuples as input and performs indexing and slicing on the tuples.
 * It also demonstrates loop control using the index of the tuples.
 *
 * @param tuples A list of tuples.
 * @return The sum of the second elements from the tuples that have an odd index.
 */
fun indexingAndSlicingTuplesLoopControl(tuples: List<Pair<Int, Int>>): Int {

    var result = 0
    for ((index, tup) in tuples.withIndex()) {
        if (index % 2 != 0) { // skip even index tuples
            result += tup.second
        }
    }
    return result
}