# How to | Create Lists

Lists are very important and general structures in the Wolfram Language. They allow you to treat collections of all kinds of objects as a single entity. There are many ways to construct them.

Use the shorthand notation {} to make a list:

 In[1]:=
 Out[1]=

Or use List, which automatically is changed to {}:

 In[2]:=
 Out[2]=

Use Range with one argument to create a list of integers starting at 1:

 In[3]:=
 Out[3]=

Or use Range with two arguments to create a list of integers starting higher:

 In[4]:=
 Out[4]=

With three arguments the offset can be different than 1:

 In[5]:=
 Out[5]=

This squares each element of the list:

 In[6]:=
 Out[6]=

Or use Table to create the first 10 squares:

 In[7]:=
 Out[7]=

Just like Range, Table can start higher or jump by any amount:

 In[8]:=
 Out[8]=

Use NestList to create a list of the results of applying f to x for 0 through 3 times:

 In[9]:=
 Out[9]=

Use Array to create a list of length 4, with elements f[i]:

 In[10]:=
 Out[10]=

This gives a 3×2 array:

 In[11]:=
 Out[11]=

Use List to create lists of strings:

 In[12]:=
 Out[12]=

A matrix in the Wolfram Language is a list of lists.

Use RandomInteger to create a 4×4 matrix of random integers between 0 and 10 (stored as m):

 In[1]:=
 Out[1]=

Use MatrixForm to see m as a 2D matrix:

 In[2]:=
 Out[2]//MatrixForm=

You can apply functions to a list.

You can directly apply math functions to a list:

 In[1]:=
 Out[1]=

Math functions keep going deeper:

 In[2]:=
 Out[2]=

Some functions give a number as a result:

 In[3]:=
 Out[3]=

Length gives the length of a list:

 In[4]:=
 Out[4]=

Use Map to apply a function to the elements of a list (not needed for math functions):

 In[5]:=
 Out[5]=

This uses Map to apply Length to each sublist:

 In[6]:=
 Out[6]=

Similarly, this finds the maximum of each sublist:

 In[7]:=
 Out[7]=