No Login Data Private Local Save

Python range() to List - Online See Generated Numbers

5
0
0
0

Python range() to List

Enter a Python range() expression and instantly see the generated list of numbers.

Quick examples:

Frequently Asked Questions

range() is a built‑in Python function that generates a sequence of numbers. It is commonly used in loops to iterate a specific number of times. It does not produce a list by itself but returns a special range object that yields numbers on demand.

In Python you simply wrap the range() call in list():
list(range(5)) → [0, 1, 2, 3, 4].
This tool does exactly that – it parses the range() expression and shows you the full list you would get.

range(stop) – from 0 to stop-1, step 1.
range(start, stop) – from start to stop-1, step 1.
range(start, stop, step) – from start to just before stop, incrementing by step.
All parameters must be integers. Step can be negative for reverse sequences.

Yes! A negative step counts down. For example, range(5, 0, -1) produces [5, 4, 3, 2, 1]. The stop value is exclusive, so numbers are generated until reaching (but not including) the stop.

This tool caps the generation at 1,000,000 numbers to prevent your browser from slowing down. If your range exceeds that, you will see the first 1,000,000 results and a note about the limit. You can still copy the complete list up to that bound.