MATHEMATICA TUTORIAL

# Making Lists of Objects

In doing calculations, it is often convenient to collect together several objects, and treat them as a single entity. Lists give you a way to make collections of objects in Mathematica. As you will see later, lists are very important and general structures in Mathematica.

A list such as is a collection of three objects. But in many ways, you can treat the whole list as a single object. You can, for example, do arithmetic on the whole list at once, or assign the whole list to be the value of a variable.

Here is a list of three numbers.
 Out[1]=
This squares each number in the list, and adds to it.
 Out[2]=
This takes differences between corresponding elements in the two lists. The lists must be the same length.
 Out[3]=
The value of is the whole list.
 Out[4]=
You can apply any of the mathematical functions in "Some Mathematical Functions" to whole lists.
 Out[5]=

Just as you can set variables to be numbers, so also you can set them to be lists.

This assigns to be a list.
 Out[6]=
Wherever appears, it is replaced by the list.
 Out[7]=

## Tutorial CollectionTutorial Collection

New to Mathematica? Find your learning path »
Have a question? Ask support »