Skip to content

Range

Range[n] returns a List of integers from 1 to n.

Range[m, n] returns a List of integers from m to n.

Attributes[Range] := {Listable, Protected}

Simple examples

In[1]:= Range[3]
Out[1]= {1, 2, 3}
In[2]:= Range[2, 5]
Out[2]= {2, 3, 4, 5}
In[3]:= Range[2, -5]
Out[3]= {}