3. Data Structures

Wikipedia suggests

In computer science, a data structure is a data organization, management and storage format that enables efficient access and modification.

Simply put data structures are used to organize data in a way that it can be stored/retrieved efficiently. The data can be any data types or even other data structures. Different data structures have their advantages/disadvantages in terms of accessing/storing/removing data speed, so they should be used as per the task/ease. They can also be called literal collections or containers. In Python, you can't/don't need to declare the size of the built-in data structures beforehand, they are dynamically scaled/released automatically in the background.

Composite Data Type, Abstract Data Type and Data Structures differences.

  1. >Composite Data Types are data structures but not all data structures are composite types.
  2. >Abstract Data Type defines only the mathematical model of the implementation of a data type i.e they only exist in pseudo code.
  3. >Data structures are the actual coded/coding implementation of the pseudo code i.e they are implemented in a programming language's code.

The built-in Data Structures explained in this chapter are list, tuple, dict and set. Additionally we'll also take a look at some of their alternatives. Later we'll check out some more built-in functions which provide additional useful operations. Let's get to it.