Answers for "kotlin ranges"

1

kotlin ranges

for (nums 
  in 5..15) {
  println(nums)
}
Posted by: Guest on September-09-2021
1

kotlin range

for (i in 1..5) print(i) 			// "12345"
for (i in 5 downTo 1) print(i) 		// "54321"
for (i in 0 until 5) { 				// "01234"
     println(i)
}
for(i in 0 until list.size()){
    println(i)
}
Posted by: Guest on April-20-2021
0

kotlin ranges

// Int range
    for (x in 1 .. 30) {
        println(x)
    }
Posted by: Guest on October-29-2020

Browse Popular Code Answers by Language