Can't iterate over input string [SOLVED]
So I'm learning Kotlin for fun but I got stuck. I want to write code that takes an input word and prints its letters on separate lines. I tried fun main(args: Array<String>) { var word = readLine() for (letter in word) { println(letter) } } but I get error: not nullable value required to call an 'iterator()' method on for-loop range I can print an input word, and I can print a word letter by letter, just not an input word letter by letter. I figured out a workaround by creating a new string by adding "" to the input string, but that shouldn't be necessary (should it?) See these 4 codes. Any ideas? Yes I used the search bar :\ https://code.sololearn.com/c82A163A15A2 https://code.sololearn.com/cPdWINY0Bkx1 https://code.sololearn.com/cA21a100a228 https://code.sololearn.com/cA8a4a8A0a99