Tsallaka zuwa abun ciki
Justice Tech School

Ranges and Progressions

A range such as 1..5 is a sequence you can test, loop over and convert.

Example
val r = 1..5
println(r.toList())
println(3 in r)
println(r.sum())
println('a'..'e')
println((1..10 step 3).toList())

Exercise

Make a list.

(1..3).()

Quiz Test

What does 5 downTo 1 do?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.