You can loop over any iterable by using the standard for-loop:
val list = listOf("Hello", "World", "!")
for(str in list) {
print(str)
}
Lots of things in Kotlin are iterable, like number ranges:
for(i in 0..9) {
print(i)
}
If you need an index while...