Range Over Built in Kotlin
Here we use range
to sum the numbers in a list. Arrays work like this too.
To run the program, put the code in Main.kt
and use kotlinc
to compile it.
Now that we can run and build basic Kotlin programs, let’s learn more about the language.