Ranges

Last updated

What is Ranges?

Ranges in Kotlin define an interval of values. You can create them using the .. operator, for example, 1..5 creates a range from 1 to 5 (inclusive). Ranges are commonly used in for loops to iterate over a sequence of numbers or characters, and you can check if a value falls within a range using the in operator. Kotlin also provides functions like step to modify the increment and downTo to create a descending range.

Free resources to learn Ranges

Ranges: common questions

Can I learn Ranges in Hindi?

This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Ranges in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.

Is this Ranges tutorial for beginners?

It is lesson 27 of 153 in the free Kotlin roadmap, in stage 8, Ranges. If you are new to Kotlin, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.

Still confused? Ask me