Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
Brackets are symbols used in programming to enclose and group together elements, such as variables or expressions, within a statement. They are typically represented by the characters "[" and "]".
Related terms
Parentheses: Parentheses are another type of grouping symbol used in programming. They are represented by the characters "(" and ")" and serve similar purposes as brackets.
Curly Braces: Curly braces, also known as curly brackets, are another type of grouping symbol used in programming. They are represented by the characters "{" and "}" and are commonly used for defining blocks of code.
Square Brackets: Square brackets, which we refer to simply as "brackets," are specifically used for indexing or accessing elements within arrays or lists in many programming languages.