Kotlin - Loops and RangesWhich statement about Kotlin's repeat function is TRUE?Arepeat executes the block exactly n times with index from 0 to n-1Brepeat returns a list of results from each block executionCrepeat can only be used with print statementsDrepeat automatically delays execution between iterationsCheck Answer
Step-by-Step SolutionSolution:Step 1: Recall repeat function behaviorrepeat runs the block n times with index from 0 to n-1, no return value.Step 2: Evaluate each optionOnly repeat executes the block exactly n times with index from 0 to n-1 correctly describes repeat's behavior; others are false.Final Answer:repeat executes the block exactly n times with index from 0 to n-1 -> Option AQuick Check:repeat runs block n times, no return list [OK]Quick Trick: repeat runs block n times with index 0 to n-1 [OK]Common Mistakes:MISTAKESThinking repeat returns a listAssuming it delays executionBelieving it only works with print
Master "Loops and Ranges" in Kotlin9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kotlin Quizzes Collections Fundamentals - Collection size and emptiness checks - Quiz 5medium Collections Fundamentals - Set creation (setOf, mutableSetOf) - Quiz 3easy Control Flow as Expressions - When with ranges and types - Quiz 9hard Control Flow as Expressions - When with multiple conditions - Quiz 6medium Data Types - Type conversion is always explicit - Quiz 4medium Kotlin Basics and JVM Runtime - Kotlin REPL and script mode - Quiz 8hard Kotlin Basics and JVM Runtime - Print and println output - Quiz 14medium Loops and Ranges - Break and continue behavior - Quiz 2easy Null Safety - Safe call operator (?.) - Quiz 9hard Operators and Expressions - Why operators are functions in Kotlin - Quiz 5medium