Bird
0
0

What does the Kotlin expression 5..10 create?

easy📝 Conceptual Q1 of 15
Kotlin - Operators and Expressions
What does the Kotlin expression 5..10 create?
AA list of numbers from 5 to 9
BA range of numbers from 5 to 10 inclusive
CA range of numbers from 6 to 10
DA set of numbers excluding 10
Step-by-Step Solution
Solution:
  1. Step 1: Understand the range operator (..)

    The operator .. creates a range including both start and end values.
  2. Step 2: Apply to 5..10

    This means numbers from 5 up to and including 10 are included.
  3. Final Answer:

    A range of numbers from 5 to 10 inclusive -> Option B
  4. Quick Check:

    Range operator (..) = inclusive range [OK]
Quick Trick: Range (..) includes both start and end numbers [OK]
Common Mistakes:
MISTAKES
  • Thinking range excludes the end number
  • Confusing range with list
  • Assuming range starts from next number

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kotlin Quizzes