Complete the code to declare an immutable variable in Kotlin.
val number = [1]In Kotlin, val declares an immutable variable, and number is assigned the value 10.
Complete the code to declare a mutable variable in Kotlin.
var count = [1]The variable count is mutable and initialized with the value 5.
Fix the error in the code by choosing the correct keyword for immutability.
[1] message = "Hello"
val declares an immutable variable, which is the correct keyword here.
Fill both blanks to create a list that cannot be changed and a list that can be changed.
val immutableList = listOf(1, 2, 3) [2] mutableList = [1](1, 2, 3) mutableList = listOf(4, 5, 6)
listOf for mutable list.val for mutable list variable.mutableListOf creates a mutable list, and var allows reassignment of mutableList.
Fill all three blanks to create a map with immutable keys and values, filtering only entries with values greater than 10.
val data = mapOf("a" to 5, "b" to 15, "c" to 20) val filtered = data.filter { ([1], [2]) -> [3] > 10 }
The lambda destructures the map entry into k and value, then filters entries where value is greater than 10.