# How to | Use Brackets and Braces Correctly

The Wolfram Language's rich syntax uses different kinds of brackets and braces; familiarity with these aspects lets you read and program efficiently in the Wolfram Language.

Parentheses ( ), braces { }, and square brackets [ ] all have different meanings in the Wolfram Language. The first two are sometimes called round brackets and curly brackets.

You use parentheses ( ) in the Wolfram Language for grouping expressions and to determine the precedence of operations:

 In[1]:=
 Out[1]=
 In[2]:=
 Out[2]=

A list in the Wolfram Language is represented by braces { } and is a collection of items referred to as elements.

Create a list of the first five positive integers:

 In[1]:=
 Out[1]=

Anything in the Wolfram Language can be used in lists, including numbers, variables, typeset mathematical expressions, and strings:

 In[2]:=
 Out[2]=

Lists can contain other lists to create nested lists:

 In[3]:=
 Out[3]=

Square brackets are used in the Wolfram Language to enclose the arguments of functions.

The functions Range, Sin, and N are used here with square brackets enclosing their arguments:

 In[4]:=
 Out[4]=
 In[5]:=
 Out[5]=
 In[6]:=
 Out[6]=

The Wolfram Language uses double square brackets as the short form [[ ]] for the Part function, which is used to get parts of lists:

 In[7]:=
 Out[7]=
 In[8]:=
 Out[8]=

The various bracketing constructions can be used together.

Plot a function, with the range of the plot specified in a list:

 In[1]:=
 Out[1]=

The ability to use functions and lists together is seamlessly integrated in the Wolfram Language. Plot two functions togetherthe pair of functions is in a list:

 In[2]:=
 Out[2]=

All bracketing characters must be balanced for the Wolfram Language to evaluate an expression. When a bracketing character is unbalanced, the the Wolfram System front end colors it purple:

 In[1]:=

Attempting to evaluate the expression produces an error:

 In[2]:=

For more information on balancing brackets and braces, see How to: Balance Brackets and Braces.