Skip to content
Jason Barr edited this page Sep 22, 2021 · 1 revision

When you just need to iterate over some numbers but you can't bring yourself to write a for loop, Range is there for you.

Like in Python, Range takes 3 arguments: start, end, and step. All arguments can be positive or negative.

Range doesn't create its values upfront, so you can iterate over a truly huge number and not have to worry about taking a memory hit for it.

Clone this wiki locally