Skip to main content

Programming Symbols

The same symbol can mean different things in different languages. This table helps identify programming punctuation; read each example in its named language. For exact syntax, consult the Python lexical reference or the relevant language’s documentation.

SymbolEnglish EquivalentDescription
.DotUsed for object property access in many languages, decimal points in numbers, and file type specification in filenames.
( )ParenthesesGroups expressions and controls operation order; encloses parameters in function definitions and arguments in calls.
[ ]Square BracketsOften used for array indexing, specifying lists, or parts of regular expressions.
{ }Curly BracesUsed to define a block of code, such as in functions or loops.
< >Angle BracketsCommonly used in HTML tags, generics in languages like Java and C#, and include statements in C++.
&AmpersandIn Python, & is bitwise AND for integers; Boolean conjunction uses and. In C, unary & obtains an address.
*AsteriskIndicates multiplication in arithmetic operations, a pointer in C languages, and wildcard characters in various contexts.
/Forward SlashUsed for division in arithmetic operations and as a delimiter in file paths and URLs.
\BackslashUsed as an escape character in strings (e.g., \n for a newline in an ordinary Python string).
^CaretRepresents the 'XOR' operation in bitwise contexts and used as a power operator in some programming environments.
%Percent SignUsed as the modulo operator in arithmetic operations, returning the remainder of a division.
;SemicolonOften used to denote the end of a statement in languages like C, C++, and Java.
:ColonSeparates the two result expressions in JavaScript’s condition ? valueIfTrue : valueIfFalse; also used in labels and type annotations.
?Question MarkIn JavaScript’s conditional operator, follows the condition and precedes the value chosen when it is true.
!Exclamation MarkRepresents logical negation in conditions.
#HashUsed for defining preprocessor directives in C/C++, and commenting in scripts like Python and Ruby.
$Dollar SignCommonly used to denote variables in scripting languages like PHP and Perl.
-DashUsed primarily for subtraction in arithmetic operations, also for negating values and in command-line arguments.
_UnderscoreOften used in variable names and function names, especially in languages adhering to snake_case conventions.
`BacktickUsed to define template literals in JavaScript, allowing embedded expressions and multi-line strings.
" and 'Quotation MarksUsed to denote string literals; the use of single or double quotes can vary by language and context.
@At SignUsed for decorators in Python, to denote email addresses in strings, and for annotations in languages like Java.

For the JavaScript entries, MDN’s expressions and operators guide provides runnable examples of logical, bitwise, and conditional operators. Compare their operands and return values rather than carrying a symbol’s meaning over from another language.

Explore connections

This note has no linked notes yet.

More on these topics (2)

Open network