In this section, we take a close look at the most important Python data types. Python provides us with several native data types to store and process data. These are essential building blocks that you need to know well. When thinking about a problem, part of the solution is often choosing the right data type. Knowing what each data type is capable of will make it much easier to pick the right one.
Basic and advanced Python data types
We distinguish between basic types and more advanced data structures. The basic data types in Python store a single value, like a number or a piece of text. The basic data types in Python are:
- Integers
- Floating point numbers
- Complex numbers
- Booleans
- Strings
Next, we have the more advanced Python data types. They can store many items, like lists of items or key-value pairs: