How to | Perform Operations on Lists

Lists are central constructs in the Wolfram Language that are used to represent collections, arrays, sets, and sequences of all kinds. Well over a thousand built-in functions throughout the Wolfram Language operate directly on lists, making them a powerful vehicle for interoperability.

Set up a list of 5 random integers between 0 and 10 (stored as ):

In[1]:=
Click for copyable input
Out[1]=

Use Max to get the largest element of :

In[2]:=
Click for copyable input
Out[2]=

Set up a 4×3 matrix of random integers between 0 and 10:

In[3]:=
Click for copyable input
Out[3]=

Use Map to apply Max to each element of at the top level:

In[4]:=
Click for copyable input
Out[4]=
    

You can add two lists of the same length element by element:

In[1]:=
Click for copyable input
Out[1]=

Add the scalar to each element of a list:

In[2]:=
Click for copyable input
Out[2]=

Multiply each element in the list by the scalar :

In[3]:=
Click for copyable input
Out[3]=
    

Set up a list of 5 integers:

In[1]:=
Click for copyable input
Out[1]=

Prepend the element at the beginning of the list :

In[2]:=
Click for copyable input
Out[2]=

Append at the end of :

In[3]:=
Click for copyable input
Out[3]=

Insert the element at position 3 of the list :

In[4]:=
Click for copyable input
Out[4]=

Delete the element at position 3 in :

In[5]:=
Click for copyable input
Out[5]=

Replace the element at position 3 in with a new element :

In[6]:=
Click for copyable input
Out[6]=

Interleave between the entries of :

In[7]:=
Click for copyable input
Out[7]=