January 2018
Intermediate to advanced
434 pages
14h 1m
English
Let's go through the following steps by which we can read console input in Kotlin:
println("Just a line")
println("Input your first name")var first_name = readLine()println("Your first name: $first_name")
println("Hi $first_name, let us have a quick math test. Enter two numbers separated by space.")val (a, b) = readLine()!!.split(' ').map(String::toInt)println("$a + $b = ${a+b}")
Read now
Unlock full access