The most used symbols in code

Get to know the parentheses, brackets, equals signs and quotes you'll meet most in code, what each does, and how to type them on a US keyboard.

Coding Published: 5 min read

On your first look at real code, the punctuation can seem louder than the words. Parentheses, square brackets, equals signs, quotes and semicolons repeat across many languages, and each one has a specific job. This guide walks through the symbols you’ll meet most often, explains what they do, and shows how to type them comfortably on a US keyboard. A short note on Turkish Q is included for readers who use that layout.

Parentheses and brackets

Most programming languages use parentheses, square brackets and curly braces for different tasks. Parentheses group values and wrap function calls. Square brackets pick items from lists and arrays. Curly braces mark blocks of code or define objects.

numbers = [10, 20, 30]
print(numbers[0])

Here the square brackets create a list and then select its first item. The parentheses wrap the value passed to print. In JavaScript, curly braces usually open a block:

if (score > 10) {
  console.log("Great job");
}

On a US keyboard, parentheses sit on the number row, square brackets sit with the punctuation keys, and braces need Shift. On Turkish Q, parentheses use Shift+8 and Shift+9, while square brackets and braces use AltGr. If you switch layouts, check these combinations first, since the same code will feel very different to type.

Brackets also nest, and reading them gets easier with a simple habit. Start from the innermost pair and work outward. In a line like print(len(numbers) * (numbers[0] + 1)), the square brackets pick the first item, the inner parentheses group the addition, and the outer parentheses belong to the call to print. Counting pairs from the inside keeps you from losing track.

Equals, plus and underscore

The equals sign assigns a value: x = 5 means “store 5 in x.” A double equals sign compares two values: x == 5 asks whether they match. Mixing these up is one of the most common beginner errors, so practice them side by side.

high_score = 120
if high_score == 120:
    print("Matched the high score")

The plus sign adds numbers or joins text. The underscore separates words in names such as high_score, a style common in Python. On a US keyboard, the plus sign and the underscore both need Shift. Get used to pressing Shift with the opposite pinky, the same habit you’d use for capital letters.

Reading assignment lines out loud helps too. The line total = total + 5 looks odd in math, but in code it means: calculate the right side using the current value, then store the result under the name on the left. Say it as “assign to” rather than “equals”, and the meaning becomes clearer.

Quotes, colons and semicolons

Quotes wrap text. Double quotes and single quotes often work the same way in Python, but a string has to close with the same kind of quote that opened it. Semicolons end statements in C and JavaScript, though Python doesn’t use them. Colons introduce blocks in Python, as in if score > 10:.

#include <stdio.h>

int main(void) {
    printf("Hello\n");
    return 0;
}

This small C program uses angle brackets in the include line, parentheses, braces, quotes and semicolons. Type it in parts: first the include line, then the function header, then the body. Breaking the code into pieces makes each symbol easier to place.

Quotes sometimes appear inside a string, and you need a way to show them without ending the string. In Python, you can escape a quote with a backslash:

print("She said \"hello\" to me")

The backslash tells Python that the next quote is part of the text. Type the backslash and the quote as a pair, and this pattern becomes much easier to remember.

Practice

Type this line, then say each symbol out loud as you press it:

( ) [ ] { } = _ " ' ; :

Next, try a short dictionary in Python. It uses brackets, braces, a colon and quotes in a few lines:

scores = {"Anna": 12, "Tom": 9}
for name, score in scores.items():
    print(name, score)

Before you run the code, check that every opening bracket has a closing one. Make this check a habit. It cuts down on the time you spend hunting for syntax errors later.

Practice doesn’t have to be long. Five minutes a day, typing one short line from this guide and reading it aloud, gives your fingers steady repetition. Choose a line with at least three different symbols, and repeat it until it comes out cleanly. Change the line each week so you don’t memorize only one pattern.

Notice which symbols slow you down. For many learners, closing brackets are harder than opening ones, because the eyes look for the open pair first. When you find your own weak symbol, give it a few extra minutes in each session.

Reading symbols in longer code

Longer code mixes all of these symbols at once. Here is a short example that uses a dictionary and a loop:

scores = {"Anna": 12, "Tom": 9}
for name, score in scores.items():
    if score > 10:
        print(name + " passed")

Start by finding the blocks. The colon at the end of each for and if line opens an indented block, so the indented lines belong to it. Next, check the pairs. The braces around the dictionary, the parentheses after items, and the parentheses around the print call each close on the same line they open. Last, look at the operators. The double equals sign compares, and the plus sign joins text.

When you read code this way, you’re not hunting for individual symbols. You’re following the structure they create, and that makes typing them feel more natural.

Common mistakes

Forgetting a closing bracket

Missing a closing parenthesis or bracket is one of the most common errors in code. To prevent it, type the pair first, then fill in the middle. Type () or [], move the cursor between the two characters, and add the content. Many editors add the closing character for you, so look at what appears before you type over it.

Mixing up = and ==

Use one equals sign to assign a value and two to compare. Writing one when you meant the other can make code behave in ways that are hard to spot at first.

Stretching for symbols

Lifting your whole arm to reach a symbol tires you out and slows you down. Keep your hand near the home row, and move only the finger that needs to reach. The more compact your movement, the steadier your typing will be over a long session.

A simple routine helps with all three mistakes. Type each pair before filling it in, read each new line back before moving on, and keep your hand near the home row. Within a week, these small checks become a habit that catches errors before they spread.

Next step

To see these symbols in real code, try the JavaScript course or the C course. Both use these symbols often, so practicing with them builds the same habit in context. If you want to tighten up your Shift habit first, read using the Shift key correctly. For a full view of the layouts, visit the keyboard layouts page.

Try what you learned

The typing test takes one minute and needs no sign-up. For steady practice, look at the 16-week courses.

Getting started with Small Basic

Learn the core ideas of Small Basic: printing text, loops, conditions, subroutines and arrays. Each one comes with a short program you can type yourself.

Coding 6 min read

Keyboard habits for learning Python

Python relies on colons, underscores, indentation and brackets. Learn simple keyboard habits that make these symbols quick to type, with short practice drills.

Coding 6 min read