🌐
Data Visualization
socviz.co
Data Visualization
In this book, and also at the R console, if what you did results in a series of things being displayed at the console (like the individual observations from a variable, or the elements of a list, and so on), each line of your output will be prefaced by a number in square brackets at the beginning.
2  Get Started
Everything works through a command line, or console. At its most basic, you launch it from your Terminal application (on a Mac) or Command Prompt (on Windows) by typing R. Once launched, R awaits your instructions at a command line of its own, denoted by the right angle bracket symbol, > (see ...
1  Look at Data
Heer and Bostock (2010) replicated Cleveland’s earlier experiments and added a few additional assessments, including evaluations of rectangular-area graphs, which have become more popular in recent years. These include treemaps, where a square or rectangle is subdivided into further rectangular ...
3  Make a Plot
A raster-based format, on the other hand, stores images essentially as a grid of squares, or pixels, of a predefined size with information about the location, color, brightness, and so on of each pixel in the grid. This makes for more efficient storage, especially when used in conjunction with ...
4  Show the Right Numbers
This chapter will continue to develop your fluency with ggplot’s central workflow while also expanding the range of things you can do with it. One of our goals is to learn how to make new kinds of graph. This means learning some new geoms, the functions that make particular kinds of plots.
🌐
Python.org
discuss.python.org › python help
Tuple declaration using square brackets - Python Help - Discussions on Python.org
July 21, 2022 - I sometimes see this Tuple declaration which is not common: VARIABLE = Tuple[List[Tuple[str, float, Dict[str, Any]]], Dict[str, str]] VAR = Tuple[…] I was expecting Tuple with parentheses. Any help to understand? Tha…
🌐
Ethz
las.inf.ethz.ch › teaching › introml-s26
Introduction to Machine Learning (2026) | Learning & Adaptive Systems Group
What programming knowledge is required for this course?A: For the programming background, we recommend knowing Python.
🌐
Quora
quora.com › Can-you-explain-the-difference-between-square-brackets-and-curly-brackets-in-Python
Can you explain the difference between square brackets and curly brackets in Python? - Quora
Answer: Meet Jon, standing in lane 1. He’s a curly bracket: His job is important but tedious. He is a librarian of sorts but his official name is the hash-mapper (with a nod to Mad Hatter). He has to know which box contains what item: In the jargon (at work), the ‘box’ (a or b) is called a key ...
🌐
Edlitera
edlitera.com › blog › posts › python-parentheses
Python Parentheses Cheat Sheet | Edlitera
In this article, I've demonstrated some of the different uses for standard parentheses, square brackets, and curly braces in Python that you can use as a cheat sheet.
🌐
SheCodes
shecodes.io › athena › 2453-how-to-use-square-bracket-syntax-in-python
[Python] - How to Use Square Bracket Syntax in Python - | SheCodes
Learn what square bracket syntax is and how to use it to access elements of an array or dictionary in Python.
Find elsewhere
🌐
Coderanch
coderanch.com › t › 737170 › languages › square-brackets-print-line
What are the square brackets around the print line used for? (Jython/Python forum at Coderanch)
November 30, 2020 - In a lot of languages, there exists a standard syntax for declaring (and displaying) complex objects. The "[]" bracket an array or list (sequential collection) The "{}" bracket a dictionary entry or object with properties: {name: value} or {name, v1= value1, v2=value2, …} The exact format ...
🌐
Wikipedia
en.wikipedia.org › wiki › YAML
YAML - Wikipedia
1 week ago - YAML targets many of the same communications applications as Extensible Markup Language (XML) but has a minimal syntax that intentionally differs from Standard Generalized Markup Language (SGML). It uses Python-style indentation to indicate nesting and does not require quotes around most string values (it also supports JSON style [...] and {...} mixed in the same file).
🌐
Mermaid
mermaid.ai › open-source › syntax › entityRelationshipDiagram.html
Entity Relationship Diagrams | Mermaid
The type values must begin with an alphabetic character and may contain digits, hyphens, underscores, parentheses and square brackets. The name values follow a similar format to type, but may start with an asterisk as another option to indicate an attribute is a primary key.
🌐
Data Science Discovery
discovery.cs.illinois.edu › guides › Python-Fundamentals › brackets
Parentheses, Square Brackets and Curly Braces in Python - Data Science Discovery
March 22, 2024 - Brief description on when to use parentheses `()`, square brackets `[]` and curly braces `{}` in python
🌐
Mrcet
mrcet.com › downloads › digital_notes › CSE › III Year › PYTHON PROGRAMMING NOTES.pdf pdf
PYTHON PROGRAMMING III YEAR/II SEM MRCET PYTHON PROGRAMMING [R17A0554]
In Python (and almost all other common computer languages), a tab character can be · specified by the escape sequence \t: >>> print("a\tb") a · b · List:  It is a general purpose most widely used in data structures ·  List is a collection which is ordered and changeable and allows duplicate members. (Grow and shrink as needed, sequence type, sortable).  To use a list, you must declare it first. Do this using square brackets and separate ·
🌐
Oreate AI
oreateai.com › blog › understanding-the-role-of-square-brackets-in-python › 11e53ced7a30c49381742208fbb219e6
Understanding the Role of Square Brackets in Python - Oreate AI Blog
January 16, 2026 - Square brackets in Python are essential for creating lists and accessing elements through indexing and slicing while enhancing readability.
🌐
GeeksforGeeks
geeksforgeeks.org › python › parentheses-square-brackets-and-curly-braces-in-python
Parentheses, Square Brackets and Curly Braces in Python - GeeksforGeeks
July 26, 2025 - Curly braces define dictionaries and sets, both of which are mutable collections. Square brackets are crucial for defining lists and accessing elements through indexing and slicing.
Top answer
1 of 3
14

They are part of the Python syntax and unlike using single (') or double (") quotes, they can pretty much never be interchanged.

Square and rounded brackets can mean so many different things in different circumstances. Just to give an example, one may think that both the following are identical:

a = [1,2,3]
a = (1,2,3)

as a[0] gives 1 in both cases. However, the first one is creating a list whereas the second is a tuple. These are different data types and not knowing the distinction can lead to difficulties.

Above is just one example where square and rounded brackets differ but there are many, many others. For example, in an expression such as:

4 * ((12 + 6) / 9)

using square brackets would lead to a syntax error as Python would think you were trying to create a nested list:

4 * [[12 + 6] / 9]

So hopefully you can see from above, that the two types of brackets do completely different things in situations which seem identical. There is no real rule of thumb for when one type does what. In general, I guess that square brackets are used mainly for lists and indexing things whereas rounded brackets are for calculations (as you would in maths) and functions etc.

Hope this helps you out a bit!

2 of 3
7

It's hard to answer succinctly, but I can give you some common examples.

Square brackets define lists:

my_list = [1, 2, 3, 4]

They are also used for indexing lists. For instance:

print(my_list[1])

Returns 2. Additionally, they are frequently used to index dictionaries, which are defined with curly brackets:

my_dict = {5:'a', 6:'b', 7:'c'}

The indexing for dictionaries requires that I input the "key" as follows:

print(my_dict[6])

Returns b.

Functions are called using round brackets. For instance, if I want to add an element to my list, I can call the append() function:

my_list.append(8)

I have just added 8 to my list. You will notice that when I called the print function I also used curved brackets.

This is by no means comprehensive, but hopefully it will give a starting point.

🌐
Sololearn
sololearn.com › en › Discuss › 3096479 › why-square-bracket-use-in-python
Why square bracket [ ]use in python | Sololearn: Learn to code for FREE!
October 22, 2022 - sumit budhwani , if you are really interested in python, i would suggest you to start learning from the tutorial *python for beginners*. do not skip this basic tutorial.
🌐
Great Learning
mygreatlearning.com › blog › it/software development › tcs nqt coding questions and answers (with code)
TCS NQT Coding Questions and Answers (with code)
August 28, 2025 - Create a mapping of opening brackets to their corresponding closing brackets. e.g., {'(': ')'}. Initialize an empty stack (a list in Python can act as a stack).
🌐
Manning
livebook.manning.com › concept › python › square-bracket
square-bracket in python
liveBooks are enhanced books. They add narration, interactive exercises, code execution, and other features to eBooks.