# 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:= Out= In:= Out= 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:= Out= Anything in the Wolfram Language can be used in lists, including numbers, variables, typeset mathematical expressions, and strings:

 In:= Out= Lists can contain other lists to create nested lists:

 In:= Out= 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:= Out= In:= Out= In:= Out= The Wolfram Language uses double square brackets as the short form [[ ]] for the Part function, which is used to get parts of lists:

 In:= Out= In:= Out= The various bracketing constructions can be used together.

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

 In:= Out= 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:= Out= 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:= Attempting to evaluate the expression produces an error:

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