> For the complete documentation index, see [llms.txt](https://pythonforstarters.solomonmarvel.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pythonforstarters.solomonmarvel.com/introduction-to-python/python-data-types.md).

# Python Data Types

#### [Data Types](broken://pages/WUC4DFlLKzb8F3hSLYzB) <a href="#data-types" id="data-types"></a>

For short, a data type describes a set of possible values and operations that can be performed on a variable

In Python, a data type is a category for values. Every value in Python has a data type, which determines the kind of operations that can be performed on that value and the way the value can be stored in memory.

There are several built-in data types in Python, including:

* Numbers: Python has three types of numbers: integers (int), floating-point numbers (float), and complex numbers (complex). Integers are whole numbers, while floating-point numbers have decimal points. Complex numbers have a real and imaginary part.
* Strings: A string is a sequence of characters, represented by either single quotes (') or double quotes ("). Strings can contain letters, numbers, and special characters.
* Lists: A list is an ordered collection of values that can be of any data type. Lists are written as a series of values separated by commas and enclosed in square brackets.
* Tuples: A tuple is similar to a list, but it is immutable, meaning that its values cannot be modified once it is created. Tuples are written as a series of values separated by commas and enclosed in parentheses.
* Sets: A set is an unordered collection of unique values. Sets are written as a series of values separated by commas and enclosed in curly braces.
* Dictionaries: A dictionary is a collection of key-value pairs. The keys must be unique and are used to retrieve the corresponding values. Dictionaries are written as a series of key-value pairs separated by commas and enclosed in curly braces.

In addition to these built-in data types, you can also define your own data types in Python using classes (more of this in an advanced topic)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pythonforstarters.solomonmarvel.com/introduction-to-python/python-data-types.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
