Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Data Types | Variables and Types
Introduction to Python
course content

Course Content

Introduction to Python

Introduction to Python

1. First Acquaintance
2. Variables and Types
3. Conditional Statements
4. Other Data Types
5. Loops
6. Functions

bookData Types

In Python, like in many other programming languages, you can work with objects of various types. It's essential to understand the differences among them, especially when considering how they're stored in computer memory. Here are the data types available in Python:

  • Text: str;
  • Numeric: int, float, complex;
  • Sequence: list, tuple, range;
  • Mapping: dict;
  • Set: set, frozenset;
  • Boolean: bool;
  • Binary: bytes, bytearray, memoryview.

Note

There's no necessity to memorize all of them at this moment.

We won't dive deep into every one of these data types right now, as we won't be using all of them immediately. Instead, we'll go into detail on each one in upcoming chapters. If you're curious about the type of a specific variable, use the type() function. And remember, always use the print() function to have Python display the result. For instance:

1234
# Create some variable var = 12 # Check variable type print(type(var))
copy
What type is the `var` variable from the example above?

What type is the var variable from the example above?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 2. Chapter 4
We're sorry to hear that something went wrong. What happened?
some-alt