๐ŸŒ
Real Python
realpython.com โ€บ python-data-structures
Common Python Data Structures (Guide) โ€“ Real Python
October 21, 2023 - Some parking lots may be restricted to only one type of vehicle. For example, a motor home parking lot wouldnโ€™t allow bikes to be parked on it. A restricted parking lot corresponds to a typed array data structure that allows only elements that have the same data type stored in them. Performance-wise, itโ€™s very fast to look up an element contained in an array given the elementโ€™s index. A proper array implementation guarantees a constant O(1) access time for this case. Python includes several array-like data structures in its standard library that each have slightly different characteristics.
๐ŸŒ
Python documentation
docs.python.org โ€บ 3 โ€บ tutorial โ€บ datastructures.html
5. Data Structures โ€” Python 3.14.4 documentation
We saw that lists and strings have many common properties, such as indexing and slicing operations. They are two examples of sequence data types (see Sequence Types โ€” list, tuple, range). Since Python is an evolving language, other sequence data types may be added.
Discussions

What are data structures anyway?
A "data structure" is a way of organizing information (i.e.: collections of data) Real/Physical world examples: * A list where you add your friend's name and phone number and any other notes one by one as you get them. * A "Contacts" book where you add your friend's names but put them in the appropriate alphabetical section. * A "Rolodex" (or box of index cards) where each person get's their own card. * A grid of columns and rows you draw on graph paper where all names are in the same column, etc. Each of these is a different way to organize or structure the data. AKA: A different data structure. Each has advantages and disadvantages. * Some are easier to get started with (implement). Like the list. * Some are easier to find a name quickly (like the contact book) * Some are easier to add a new person in the middle (like the Rolodex/Index Cards) * Some take up more physical space and are harder to carry around (Like the Rolodex) You choose which to use based on your own criteria. Do you have a small number of people so a little list of 10 is fine? Do you have a large list of people (like 100) where a list would be unwieldly so you buy a little contacts book with alphabetic tabs on the side? Do you add and remove people frequently (like in a business) where a Rolodex is better? Do you need to take the numbers with you (like when you go on vacation) so a little book is better? Or do you only need the numbers when at your desk at work, where a big fat Rolodex is fine?? As far as the built in strings, integers, Booleans, etc.: Programmers generally call those data types, not data structures. Are they technically little data structures? Yeah, maybe. But it's not worth worrying about. Just call those data types and the bigger things data structures. More on reddit.com
๐ŸŒ r/learnpython
42
91
August 18, 2024
Is there any difference between data types and data structures in python? - Stack Overflow
Ok, so python specific. What do you think a data structure is? ... This is actually a great question and should have a clear stackoverflow answer to understand the concept. ... In almost every programming language data type simply is the type of data that you would be using.In python we have ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Python Data Types
After teaching Python a bit, I found that this type of showcases, that lists data types, without mentioning that these aren't actual types, and that they are not limited to these by far, make it harder to explain later the concept of a data type in general, custom types and the "Everything is an object" concept. Since this is a beginner level showcase, it has to be specified that this talks about builtin functions and types associated with them, which is just a drop in the ocean compared to everything in the standard library, and everything in PyPi, and everything that people make on their own. Diving into the article itself, there are several issues that I consider severe: There is no "Number" data type in Python. There are many data types that can be used for numbers. Saying that a set doesn't have an index is misleading. A set isn't ordered so you can't retrieve an item by its ordinal number, but a set is an index the same way a list is an index. A dict isn't made up of key pairs, but key+value pairs. Dicts are ordered, by insertion order. Dicts are mutable Both dict and set don't require the keys to be different. In fact, they can be the same, as long as the hash() function is different. As demonstrated in the code snippet below, and provided output: class Liar: def __init__(self, value): self.value = value def __repr__(self): return f"Liar('{self.value}')" def __str__(self): return self.value def __eq__(self, other): return self.value == other.value def __hash__(self): return id(self) my_set = set() my_dict = {} liar1 = Liar("foo") liar2 = Liar("foo") print(f"{(liar1==liar2)=}") my_set.add(liar1) my_set.add(liar2) print(f"{my_set=}") my_dict[liar1] = 1 my_dict[liar2] = 2 print(f"{my_dict=}") (liar1==liar2)=True my_set={Liar('foo'), Liar('foo')} my_dict={Liar('foo'): 1, Liar('foo'): 2} This is a common misconception across developers, who learned from incorrect sources like these ones, and end up causing bugs in code. More on reddit.com
๐ŸŒ r/Python
5
9
October 19, 2021
Learning data structures
Just because python has good built in data types doesn't mean you can't experiment with linked lists, binary trees, hash tables and all that. You wouldn't use your code in real-world solutions, of course, but you can implement basic data structures and get a feel for their strengths and weaknesses. More on reddit.com
๐ŸŒ r/learnpython
45
239
June 28, 2020
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-data-structures
Python Data Structures - GeeksforGeeks
We will discuss all the in-built data structures like list tuples, dictionaries, etc. as well as some advanced data structures like trees, graphs, etc. Python Lists are just like the arrays, declared in other languages which is an ordered collection of data. It is very flexible as the items in a list do not need to be of the same type.
Published ย  July 23, 2025
๐ŸŒ
Corporate Finance Institute
corporatefinanceinstitute.com โ€บ home โ€บ resources โ€บ python data structures
Python Data Structures - Overview, Types, Examples
November 23, 2023 - The basic Python data structures in Python include list, set, tuples, and dictionary. Each of the data structures is unique in its own way. Data structures are โ€œcontainersโ€ that organize and group data according to type.
๐ŸŒ
Analytics Vidhya
analyticsvidhya.com โ€บ home โ€บ data structures in python
Data Structures in Python
April 3, 2025 - Ans. Data structures in Python are ways to organize and store data. Common ones include lists, tuples, dictionaries, sets, and more advanced ones like stacks, queues, and linked lists. Q2. What are the 4 types of data structure?
๐ŸŒ
Built In
builtin.com โ€บ data-science โ€บ python-data-structures
What Are Python Data Structures? (Definition, Examples) | Built In
There are four main types of built-in Python data structures: lists, tuples, sets and dictionaries.
๐ŸŒ
DataCamp
datacamp.com โ€บ tutorial โ€บ data-structures-python
Python Data Structures with Primitive & Non-Primitive Examples | DataCamp
December 8, 2017 - Generally, data structures can be divided into two categories in computer science: primitive and non-primitive data structures. The former are the simplest forms of representing data, whereas the latter are more advanced: they contain primitive data structures within more complex data structures ...
๐ŸŒ
Anaconda
anaconda.com โ€บ home โ€บ blog โ€บ python data structures: types, use cases, and complexity
Python Data Structures: Types, Use Cases, and Complexity | Anaconda
December 11, 2025 - In Python, they range from built-in types (like lists and dictionaries) to specialized implementations in libraries (like NumPy and pandas.) Each structure offers different trade-offs ...
Find elsewhere
๐ŸŒ
Vagrant
ashki23.github.io โ€บ python-str.html
Python data structures
Dictionaries (also called dicts) are key data structure including a set of keys and values. Unlike sequences (e.g. lists and tuples) which are indexed by a range of numbers, dictionaries are indexed by unique and immutable keys. At the same time, values of the list could be any type (mutable or immutable) and duplicated.
๐ŸŒ
Dataquest
dataquest.io โ€บ blog โ€บ data-structures-in-python
Python Data Structures: Lists, Dictionaries, Sets, Tuples โ€“ Dataquest
May 12, 2025 - Python has four main data structures split between mutable (lists, dictionaries, and sets) and immutable (tuples) types. Lists are useful to hold a heterogeneous collection of related objects.
๐ŸŒ
Edureka
edureka.co โ€บ blog โ€บ data-structures-in-python
Data Structures in Python | List, Tuple, Dict, Sets, Stack, Queue
November 27, 2024 - The collections module in Python provides specialized container data types that extend the functionality of built-in types like lists, dictionaries, and tuples. Here are some key data structures from the collections module, along with code examples and its output:
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ what are data structures anyway?
r/learnpython on Reddit: What are data structures anyway?
August 18, 2024 -

Let me try to frame my question. Self learner here.

For some reason I thought that string, integer, list, set, tuple and dictionary are data structures and every language has came up with its own data structures. I guess some languages have array and etc.

However, recently I've started a course on data structures and it teaches Linked List, Stack and Trees. None of them are implemented in Python out of box (as long as I understand). And yet if one asks ChatGPT if Python has Stack here is the answer: "Yes, Python provides several ways to implement a stack, even though it doesn't have a built-in stack data structure explicitly named "Stack." The most common ways to implement a stack in Python are:...". Turns out Python's list is a Stack where you can append() and pop() elements. On top of this "Python's collections module provides a deque (double-ended queue) that is optimized for fast appends and pops from both ends."

So I am confused now, and trying to make sence of all this info.

What is data structure, who came up with them and who defines them? Are they kind of protocols and programmers are agree on?

Top answer
1 of 21
126
A "data structure" is a way of organizing information (i.e.: collections of data) Real/Physical world examples: * A list where you add your friend's name and phone number and any other notes one by one as you get them. * A "Contacts" book where you add your friend's names but put them in the appropriate alphabetical section. * A "Rolodex" (or box of index cards) where each person get's their own card. * A grid of columns and rows you draw on graph paper where all names are in the same column, etc. Each of these is a different way to organize or structure the data. AKA: A different data structure. Each has advantages and disadvantages. * Some are easier to get started with (implement). Like the list. * Some are easier to find a name quickly (like the contact book) * Some are easier to add a new person in the middle (like the Rolodex/Index Cards) * Some take up more physical space and are harder to carry around (Like the Rolodex) You choose which to use based on your own criteria. Do you have a small number of people so a little list of 10 is fine? Do you have a large list of people (like 100) where a list would be unwieldly so you buy a little contacts book with alphabetic tabs on the side? Do you add and remove people frequently (like in a business) where a Rolodex is better? Do you need to take the numbers with you (like when you go on vacation) so a little book is better? Or do you only need the numbers when at your desk at work, where a big fat Rolodex is fine?? As far as the built in strings, integers, Booleans, etc.: Programmers generally call those data types, not data structures. Are they technically little data structures? Yeah, maybe. But it's not worth worrying about. Just call those data types and the bigger things data structures.
2 of 21
42
First rule of LLMs: never trust their output.
๐ŸŒ
Codecademy
codecademy.com โ€บ article โ€บ python-data-structures
A Guide to Python Data Structures | Codecademy
Heterogeneous: Lists can contain a mix of data types (e.g., integers, strings, other lists). Indexable and iterable: We can access elements using indices and loop through them using loops like for or while. Supports nesting: Lists can contain other lists or even more complex structures like dictionaries. Here is an example that demonstrates the usage of lists in Python:
๐ŸŒ
Educative
educative.io โ€บ blog โ€บ 8-python-data-structures
8 common data structures in Python every programmer must know
February 16, 2021 - Dictionary (dict): Similar to hashmap or hash tables in other languages, a dictionary is a collection of key/value pairs. You initialize an empty dictionary with empty curly braces and fill it with colon separated keys and values. All keys are unique, immutable objects. Now, letโ€™s see how we can use these structures to create all the advanced structures interviewers are looking for. Python does not have a built in array type, but you can use lists for all of the same tasks.
๐ŸŒ
The Python Coding Book
thepythoncodingbook.com โ€บ home โ€บ 4 | data, data types and data structures
4 | Data, Data Types and Data Structures - The Python Coding Book
November 12, 2023 - Youโ€™ve already used one of these, the list. A list is a sequence and an iterable, and itโ€™s mutable. Youโ€™ll shortly learn about the other two basic data structures in Python: tuples and dictionaries. Python has many other data types, including data structures.
๐ŸŒ
Airbyte
airbyte.com โ€บ data integration platform โ€บ data engineering resources โ€บ 11 types of python data structures for data analysis
11 Types Of Python Data Structures For Data Analysis | Airbyte
September 2, 2025 - Python data structures, including mutable types like lists, dictionaries, and sets, and immutable types like tuples, form the backbone of efficient data analysis and engineering workflows.
๐ŸŒ
Devopedia
devopedia.org โ€บ python-data-structures
Python Data Structures
February 15, 2022 - Among the basic data types and structures in Python are the following: ... All of the above are classes from which object instances can be created. In addition to the above, more data types/structures are available in modules that come as part of any default Python installation: collections, heapq, array, enum, etc.
๐ŸŒ
ScholarHat
scholarhat.com โ€บ home
Data Structures in Python - Types & Examples(A Complete Guide)
September 10, 2025 - Non-Primitive Data Structures: They don't just store a value, but rather a collection of values in various formats. They can store data of more than one type. Non-primitive data structures can further be categorized into two categories: Built-In: Python offers implicit support for built-in structures that enable storing and accessing data e.g.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ python_data_structure โ€บ python_data_structure_introduction.htm
Python - DS Introduction
List โˆ’ It is similar to array with the exception that the data elements can be of different data types. You can have both numeric and string data in a python list. Tuple โˆ’ Tuples are similar to lists but they are immutable which means the values in a tuple cannot be modified they can only be read. Dictionary โˆ’ The dictionary contains Key-value pairs as its data elements. In the next chapters we are going to learn the details of how each of these data structures can be implemented using Python.