Hello guys. I have stupid question as beginner.. P...
# getting-started
l
Hello guys. I have stupid question as beginner.. Please explain and help me
Copy code
val list = mutableListOf(0.1, 0.2, 0.3)
    for (x in list) {
        x = 2.0
        println(x)
    }
is not compiling because
val x cannot be reassigned
http://prntscr.com/it5xki 1. I have mutable list 2. Why I can’t change all values in the list to
2.0
?