Kotlin Loops in Kotlin Repeat an action x times


Example

repeat(10) { i ->
    println("This line will be printed 10 times")
    println("We are on the ${i + 1}. loop iteration")
}