# Parts of Expressions

Since lists are just a particular kind of expression, it will come as no surprise that you can refer to parts of any expression much as you refer to parts of a list.

You can refer to parts of an expression such as just as you refer to parts of nested lists.

You should realize that the assignment of indices to parts of expressions is done on the basis of the internal Wolfram Language forms of the expression, as shown by FullForm. These forms do not always correspond directly with what you see printed out. This is particularly true for algebraic expressions, where the Wolfram Language uses a standard internal form, but prints the expressions in special ways.

You can manipulate parts of expressions just as you manipulate parts of lists.

Part[expr,n] or expr[[n]] | the part of expr |

Part[expr,{n_{1},n_{2},…}] or expr[[{n_{1},n_{2},…}]] | |

a combination of parts of an expression | |

Part[expr,n_{1};;n_{2}] | parts through of an expression |

ReplacePart[expr,n->elem] | replace the part of expr by elem |

Functions for manipulating parts of expressions.

"Manipulating Elements of Lists" discusses how you can use lists of indices to pick out several elements of a list at a time. You can use the same procedure to pick out several parts in an expression at a time.

Any part in an expression can be viewed as being an argument of some function. When you pick out several parts by giving a list of indices, the parts are combined using the same function as in the expression.