How To Get Range?

Use the `range()` function in Python

Syntax: `range(stop)`

Syntax: `range(start, stop)`

Syntax: `range(start, stop, step)`

Example: `range(5)`

Example: `range(1, 5)`

Example: `range(1, 10, 2)`

Convert to a list with `list(range(…))`

Use in loops with `for i in range(…)`

Suggested for You

Trending Today