The code below shows a typical way to show both index and value in many languages, including Kotlin. Which line of code shows a way to get both index and value more idiomatically?kotlinvar ndx = 0;for (value in 1..5){ println('$ndx - $value') ndx++}

🎲 Try a Random Question  |  Total Questions in Quiz: 83  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
Kotlin Quiz — practice the complete quiz, review flashcards, or try a random question.

Kotlin MCQs For LinkedIn Skill Assessments.


The code below shows a typical way to show both index and value in many languages, including Kotlin. Which line of code shows a way to get both index and value more idiomatically?<br>kotlin<br>var ndx = 0;<br>for (value in 1..5){<br> println('$ndx - $value')<br> ndx++<br>}<br>