Kotlin Programming Language
notes and observations about Kotlin Programming Language
Created: Oct 21, 2022 by Pradeep Gowda. Updated: Oct 25, 2022 Tagged: kotlin, java
Reading
For the Pythonista
Kotlin uses >>>
as the prompt for it’s REPL. This is nice and familiar for a Pythonista.
Looping
This program in Python
= ['apple', 'orange', 'banana']
fruits for i, f in fruits:
print(f'{i+1}\t{f}')
in Kotlin becomes:
val fruits = listOf("hello", "world", "apple")
for ((i, f) in fruits.withIndex()) {
("${i+1}\t${f}")
println}
A lot more ()
and {}
, I know.