Data Types and Structures in Python
Python is one of the most popular programming languages in the world, and one of the reasons for its success is its simplicity and versatility. If you are just starting out with Python, one of the most important things you need to learn is how data types and data structures work.
In this blog, we’ll quickly go over the basics of Python data types and the common data structures you’ll be using all the time.

Python Data Types
Data types define the kind of value a variable can hold. In Python, the most common data types are:
- String (str) – A sequence of characters, e.g. "Hello World"
- Integer (int) – Whole numbers, e.g. 10, -3, 1000
- Float (float) – Decimal numbers, e.g. 3.14, -2.5
Python Data Structures
Data structures help you organize and manage collections of data. Python has several built-in structures:
- List (list) – Ordered, mutable collection, e.g. [1, 2, 3, "hello"]
- Tuple (tuple) – Ordered, immutable collection, e.g. (1, 2, 3)
- Set (set) – Unordered collection of unique items, e.g. {1, 2, 3}
- Dictionary (dict) – Key-value pairs, e.g. {"name": "Lennox", "age": 25}
Slicing in Python
Slicing allows you to extract parts of sequences like lists, strings, and tuples.
For example:
numbers = [10, 20, 30, 40, 50] print(numbers[1:4]) # Output: [20, 30, 40]
This returns elements starting at index 1 up to (but not including) index 4.
Why This Matters
Mastering Python’s data types and data structures is the first step toward becoming a confident Python programmer. Once you understand these basics, you’ll be able to move on to more advanced concepts like functions, classes, and algorithms with ease.
Google Colab Link: https://colab.research.google.com/drive/1oRQXE5485TLEjZnZ5ihzpzEyLFaKmI2P?usp=sharing
📺 Want to see all these concepts explained with examples?
👉 Check out the youtube channel here
Understanding Python Data Types and Data Structures (Beginner’s Guide)