for Loops
for walks any iterable. Ranges use .., until, downTo and step.
Example
for (i in 1..3) print("$i ")
println()
for (i in 10 downTo 1 step 3) print("$i ")
println()
for (i in 0 until 3) print("$i ")
println()Exercise
Exclude the end.
0 3
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.