Android ● ○ ○ Kotlin 2.0

Kodebits Day 70: Range Progression

Aug 5 2026
Practice ranges with a short kotlin challenge.

What does this print?

fun main() {
  val r = (2..10 step 3).toList()
  println(r.sum())
}


Try it in the online Kotlin Playground →

[spoiler title="Solution"]

Answer:

15

Explanation:

Range with step creates a progression: [2, 5, 8].

[/spoiler]


Further Reading