

Understanding Python Collection Symbols: A Simple Memory Technique

Working with Python collections—lists, tuples, and dictionaries—is fundamental for any developer. However, one common source of confusion, especially for those new to Python, is remembering which brackets or symbols are used for each type.
This blog post outlines a simple and effective technique to avoid this confusion and write cleaner, more accurate code.
The Problem
Python provides three primary built-in collection types:
list
— an ordered, mutable sequencetuple
— an ordered, immutable sequencedict
— a collection of key-value pairs
Each of these uses a different symbol:
[]
for lists()
for tuples{}
for dictionaries
Despite the differences, it's easy to mistakenly swap these brackets, especially when moving quickly or switching between languages.
A Simple Trick: Use the Third Character
To eliminate this confusion, a helpful memory technique is to focus on the third character in the name of the collection:
Collection | Third Letter | Symbol | Description |
| S |
| Square Brackets |
| P |
| Parentheses |
| C |
| Curly Braces |
This subtle pattern can serve as a quick mental reference, particularly when context-switching or reviewing code.
Practical Example
Using the third character technique, you can more easily recall:
- "S" for Square brackets →
List
- "P" for Parentheses →
Tuple
- "C" for Curly braces →
Dict
What about Set
set
also uses curly braces {}
, it's often confused with dict
. but as dict always have key-value pairs but set always have single unique values
If it's {}
with key-value, it's a dict
If it's {}
with only values, it's a set
Conclusion
Being precise with syntax is crucial when working with any programming language. Small errors—like using the wrong brackets—can lead to bugs or unintended behavior. Leveraging memory techniques like this one helps reduce errors and reinforces long-term understanding.
For professionals aiming to write robust and readable Python code, clarity in syntax is as important as the logic itself.