# Parenthesis

Updated: 01/18/2023 by Computer Hope

A parenthesis is a punctuation mark used to enclose information, similar to a bracket. The open parenthesis, which looks like (, is used to begin parenthetical text. The close parenthesis, ), denotes the end of parenthetical text. The plural of parenthesis is parentheses.

Tip

Parentheses are also called curved brackets, especially outside of the United States.

## How to type parentheses

To type an open parenthesis on a U.S. keyboard, hold down the Shift and press 9 at the top of the keyboard. To type a close parenthesis, hold Shift and press 0 (zero).

Tip

Doing the Alt code Alt+40 can also create an open parenthesis and Alt+41 creates a close parenthesis.

To create a tilde on a smartphone or tablet, open the touch keyboard, switch to the numbers (123) or symbols (sym) section, and touch the "(" or ")" symbol.

## What are parentheses used for?

• In writing, parentheses can express additional information, an aside, or special remarks. For instance, "The child received a stern lecture (and he deserved it)."
• In mathematical expressions, parentheses denote priority in the order of operations. Parts of the expression enclosed in parentheses are to be calculated first, and the result used in the rest of the expression. For instance, in this expression:
`5 + 2 x 5 = 15`

Multiplication is peformed before addition, according to the standard order of operations. However, in this expression:

`( 5 + 2 ) x 5 = 35`

The addition inside the parentheses is performed first, and the sum is then used in the rest of the expression. This kind of math expression, where the result depends upon the position of parentheses, is called non-associative.

## Parentheses in computer programming

Below is an example of how parentheses may be used in an if statement, using the Perl programming language.

```if (\$test =~ /[a-zA-z]/) {
print "It works!\n";
}```

## Regular expression parentheses

With regular expressions, parentheses capture text. For example, in the following Perl regular expression, the variable \$piglatin takes anything beginning with "th" and moves it to the end of the line.

`\$piglatin =~ s/^(th)(.*)/\2\1/i;`

`=sum(a1:a5)`
`RAM (random access memory) is a type of computer memory that stores information temporarily.`