Fellter
10/22/2026, 2:14 PM// assigns variables x, y, z to integer value 5
val x, y, z = 5
// alternatively:
val x, val y, val z = 5
Or optionally, similarly to Python, we could declare them on a single line, but assign a different value to each of them:
// the number of variables and assigned values would have to match (3 -> 3)
val x, y, z = 1, 2, 3
I understand that it might be hard to grasp at a first glance considering Kotlin has name based destructuring, but it could be useful in some scenariosephemient
10/22/2026, 2:31 PMval [x, y, z] = [1, 2, 3]Fellter
10/22/2026, 8:14 PMAlejandro Serrano.Mena
10/23/2026, 7:27 AM[val x, val y, val z] = [1, 2, 3]