Kotlin untuk I dalam kisaran cara mendapatkan nilai indeks i

val mylist = listOf("karate","taekwondo","sumo","boxing")
for ((index, value) in mylist.withIndex()) {
    println("the element at $index is $value")
}
Prickly Penguin