Square brackets are lists while parentheses are tuples.

A list is mutable, meaning you can change its contents:

>>> x = [1,2]
>>> x.append(3)
>>> x
[1, 2, 3]

while tuples are not:

>>> x = (1,2)
>>> x
(1, 2)
>>> x.append(3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'append'

The other main difference is that a tuple is hashable, meaning that you can use it as a key to a dictionary, among other things. For example:

>>> x = (1,2)
>>> y = [1,2]
>>> z = {}
>>> z[x] = 3
>>> z
{(1, 2): 3}
>>> z[y] = 4
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'

Note that, as many people have pointed out, you can add tuples together. For example:

>>> x = (1,2)
>>> x += (3,)
>>> x
(1, 2, 3)

However, this does not mean tuples are mutable. In the example above, a new tuple is constructed by adding together the two tuples as arguments. The original tuple is not modified. To demonstrate this, consider the following:

>>> x = (1,2)
>>> y = x
>>> x += (3,)
>>> x
(1, 2, 3)
>>> y
(1, 2)

Whereas, if you were to construct this same example with a list, y would also be updated:

>>> x = [1, 2]
>>> y = x
>>> x += [3]
>>> x
[1, 2, 3]
>>> y
[1, 2, 3]
Answer from jterrace on Stack Overflow
🌐
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 - Curly braces {} serve two main ... Grouping Expressions Parentheses () is often used to explicitly define the order of operations, where expressions within parentheses are evaluated first....
🌐
GeeksforGeeks
geeksforgeeks.org › python › parentheses-square-brackets-and-curly-braces-in-python
Parentheses, Square Brackets and Curly Braces in Python - GeeksforGeeks
July 26, 2025 - Parentheses are versatile, used for function calls, defining tuples, and grouping expressions. Curly braces define dictionaries and sets, both of which are mutable collections. Square brackets are crucial for defining lists and accessing elements ...
Top answer
1 of 7
332

Square brackets are lists while parentheses are tuples.

A list is mutable, meaning you can change its contents:

>>> x = [1,2]
>>> x.append(3)
>>> x
[1, 2, 3]

while tuples are not:

>>> x = (1,2)
>>> x
(1, 2)
>>> x.append(3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'tuple' object has no attribute 'append'

The other main difference is that a tuple is hashable, meaning that you can use it as a key to a dictionary, among other things. For example:

>>> x = (1,2)
>>> y = [1,2]
>>> z = {}
>>> z[x] = 3
>>> z
{(1, 2): 3}
>>> z[y] = 4
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'

Note that, as many people have pointed out, you can add tuples together. For example:

>>> x = (1,2)
>>> x += (3,)
>>> x
(1, 2, 3)

However, this does not mean tuples are mutable. In the example above, a new tuple is constructed by adding together the two tuples as arguments. The original tuple is not modified. To demonstrate this, consider the following:

>>> x = (1,2)
>>> y = x
>>> x += (3,)
>>> x
(1, 2, 3)
>>> y
(1, 2)

Whereas, if you were to construct this same example with a list, y would also be updated:

>>> x = [1, 2]
>>> y = x
>>> x += [3]
>>> x
[1, 2, 3]
>>> y
[1, 2, 3]
2 of 7
14

One interesting difference :

lst=[1]
print lst          // prints [1]
print type(lst)    // prints <type 'list'>

notATuple=(1)
print notATuple        // prints 1
print type(notATuple)  // prints <type 'int'>
                                         ^^ instead of tuple(expected)

A comma must be included in a tuple even if it contains only a single value. e.g. (1,) instead of (1).

Top answer
1 of 4
82

Square brackets: []

Lists and indexing/lookup/slicing

  • Lists: [], [1, 2, 3], [i**2 for i in range(5)]
  • Indexing: 'abc'[0]'a'
  • Lookup: {0: 10}[0]10
  • Slicing: 'abc'[:2]'ab'

Parentheses: () (AKA "round brackets")

Tuples, order of operations, generator expressions, function calls and other syntax.

  • Tuples: (), (1, 2, 3)
    • Although tuples can be created without parentheses: t = 1, 2(1, 2)
  • Order of operations: (n-1)**2
  • Generator expressions: (i**2 for i in range(5))
  • Function or method calls: print(), int(), range(5), '1 2'.split(' ')
    • with a generator expression: sum(i**2 for i in range(5))

Curly braces: {}

Dictionaries and sets, as well as in string formatting

  • Dicts: {}, {0: 10}, {i: i**2 for i in range(5)}
  • Sets: {0}, {i**2 for i in range(5)}
    • Except the empty set: set()
  • In string formatting to indicate replacement fields:
    • F-strings: f'{foobar}'
    • Format strings: '{}'.format(foobar)

Regular expressions

All of these brackets are also used in regex. Basically, [] are used for character classes, () for grouping, and {} for repetition. For details, see The Regular Expressions FAQ.

Angle brackets: <>

Used when representing certain objects like functions, classes, and class instances if the class doesn't override __repr__(), for example:

>>> print
<built-in function print>
>>> zip
<class 'zip'>
>>> zip()
<zip object at 0x7f95df5a7340>

(Note that these aren't proper Unicode angle brackets, like ⟨⟩, but repurposed less-than and greater-than signs.)

2 of 4
5

In addition to Maltysen's answer and for future readers: you can define the () and [] operators in a class, by defining the methods:

  • __call__(self[, args...]) for ()
  • __getitem__(self, key) for []

An example is numpy.mgrid[...]. In this way you can define it on your custom-made objects for any purpose you like.

🌐
Edlitera
edlitera.com › blog › posts › python-parentheses
Python Parentheses Cheat Sheet | Edlitera
If you try to just leave nothing between the curly braces, Python will automatically create a dictionary. Therefore, to create an empty set you must invoke set(). ... The standard way to format strings in Python is to use a combination of curly braces and standard parenthesis, by inserting empty curly braces in the place where you want to add something to a string.
🌐
Reddit
reddit.com › r/learnprogramming › [python] can someone eli5 brackets vs parentheses?
r/learnprogramming on Reddit: [Python] Can someone ELI5 brackets vs parentheses?
May 30, 2018 -

I'm working through challenges on edabit and it seems a lot of these I can't figure out because I don't fully understand the syntax of built in functions. A lot of these will output an error if parentheses are used in a certain area, but will work perfectly if brackets are used. But I don't understand how/when to know that brackets are correct?

example:

def name_shuffle(name):
    first, last = name.split()
    return ' '.join([last,first])
print(name_shuffle('John Smith'))

I don't know why brackets need to be used in line 3. A lot of other functions seem to utilize brackets as well in situations like this.

🌐
Sololearn
sololearn.com › en › Discuss › 1733735 › what-is-the-difference-between-parentheses-brackets-and-braces-in-a-python-code
Sololearn: Learn to Code
March 23, 2019 - Brackets are used to make lists Braces are used to make dictionary Parenthesis are used to make tuple But for indexing in all of those, only brackets are used.
Find elsewhere
🌐
Afeld
python-public-policy.afeld.me › en › columbia › brackets.html
Brackets in Python and pandas — Python for Public Policy @ Columbia University
In Python, parentheses are used in function definitions to specify the arguments. ... Then, parentheses are used to call functions, passing in the arguments (if any). ... When making a new instance of a class, you use parentheses after the class name. We saw this above with pd.DataFrame(). ...
🌐
Kodeclik
kodeclik.com › brackets-in-python
Brackets in Python: Parentheses, Square Brackets and Curly Braces
March 21, 2025 - Here's an example of using parentheses ... my_tuple = (1, 2, 3) print(my_tuple) ... Square brackets [] are primarily used for creating lists and indexing elements in lists or dictionaries....
🌐
DataScience Ville
datascienceville.com › brackets-vs-parentheses-vs-braces-in-python
Brackets vs Parentheses vs Braces in Python - What's the Difference? - DataScience Ville
January 13, 2026 - It’s common to get confused by brackets, parentheses, and braces. Many times in writing, we often use them interchangeably. But do that in Python, and you’ll find your code returning errors. That’s just how confusing programming can get. Before we delve into the “brackets vs parentheses ...
🌐
Plain English
python.plainenglish.io › pythons-brackets-parentheses-and-curly-braces-60cdc236cdd6
Python’s Brackets, Parentheses, and Curly Braces | by Emmanuel Adebanjo | Python in Plain English
August 22, 2023 - Another use for the parentheses is to communicate to the interpreter that we know what we are doing and we want a certain operation to be done exactly the way we had specified(parenthesized). Pro tip: Normally operations are run from left to right in Python based on operator precedence.
🌐
Tutorials
onlinetutorialhub.com › home › python tutorial › brackets, braces and parentheses in python
Brackets, Braces and Parentheses in Python
May 10, 2025 - Python, in contrast to certain other programming languages, defines code blocks largely with indentation rather than curly brackets. ... Lists are mutable data types that are created with brackets. defines a list, for instance.
🌐
Reuven Lerner
lerner.co.il › home › blog › python › python parentheses primer
Python parentheses primer — Reuven Lerner
November 10, 2022 - The square brackets tell Python that this is a list comprehension, producing a list. If you use curly braces, you’ll get either a set or a dict back, and if you use regular parentheses, you’ll get a generator expression (see above).
🌐
GeeksforGeeks
geeksforgeeks.org › brackets-and-parentheses
Brackets vs. Parentheses - Definition, Types and Examples - GeeksforGeeks
August 15, 2022 - Brackets are symbols, such as parentheses ( ), curly brackets { }, and square brackets [ ], etc that are mostly used to group expressions or clarify the order in which operations are to be done in an algebraic expression.Different Brackets and ...
🌐
CliffsNotes
cliffsnotes.com › questions & answers › python programming › 1- explain the difference between the use of parentheses ( ), and the use of square brackets [ ] when creating lists...
[Solved] 1- Explain the difference between the use of parentheses ( ), and the use of square brackets [ ] when creating lists... | CliffsNotes
April 21, 2023 - 1- Explain the difference between the use of parentheses ( ), and the use of square brackets [ ] when creating lists in Python. 2- Mention and explain the 9 operators or functions that can be applied to a list in Python. 3- Mention and explain the 5 methods that allow you to add or delete elements in a list. 4- Indicate what are the parameters and the arguments in a function in Python and what is the difference between them. 5-vWhat is the use of braces { } when using dictionaries in Python?
🌐
Quora
quora.com › What-is-the-difference-between-and-brackets-in-Python
What is the difference between {} and [] brackets in Python? - Quora
Ordered (insertion order preserved since Python 3.7). Keys must be hashable (immutable types like int, str, tuple). Access: d[key]; membership tests check keys: key in d. Set literal: {a, b, c} (empty set cannot be {}, see below). Elements must be hashable. Operations: union (|), intersection (&), difference (-). ... Curly braces {} and square brackets [] are syntactically and semantically different in Python.
🌐
Medium
medium.com › @garybao › understanding-the-use-of-parentheses-vs-square-brackets-in-python-comprehensions-abbe074dac9d
Understanding the Use of Parentheses vs. Square Brackets in Python Comprehensions | by Gary Bao | Medium
December 13, 2024 - In Python, comprehensions are powerful tools for creating lists, dictionaries, or sets in a concise and readable way. However, there’s an important distinction between using parentheses () and square brackets [] when working with comprehensions, particularly in contexts like summing values or filtering data. This article explores the difference and explains when and why you should choose one over the other.