Complete the code to create an immutable list of integers.
val numbers = [1](1, 2, 3, 4, 5)
The listOf function creates an immutable list in Kotlin.
Complete the code to create a mutable list of strings.
val fruits = [1]("apple", "banana", "cherry")
The mutableListOf function creates a mutable list that can be changed later.
Fix the error in the code to create a mutable list of doubles.
val prices = [1](10.5, 20.0, 30.75)
To create a mutable list, use mutableListOf. listOf creates an immutable list.
Fill both blanks to create an immutable list and get its size.
val colors = [1]("red", "green", "blue") val size = colors.[2]
listOf creates an immutable list, and size gets the number of items in the list.
Fill all three blanks to create a mutable list, add an item, and get the last element.
val animals = [1]("cat", "dog") animals.[2]("rabbit") val last = animals.[3]()
mutableListOf creates a mutable list, add adds an item, and last() gets the last element.
