List Size in Kotlin

Level 129 keystrokes

Creates a list and prints its size.

Kotlin code

// listOf() creates a read-only list
// size returns the number of elements: 3
1println(listOf(1, 2, 3).size)

Output

3
Practice typing this code

Practice typing this code. Results are not recorded in the rankings.

Symbols in this code

The symbols you type in this Kotlin code and how often they appear.

  • ,× 2
  • (× 2
  • )× 2
  • .× 1

More Kotlin examples at level 1

← Kotlin typing practice