course content

Course Content

Introduction to Python

Data TypesData Types

In Python, like in most programming languages, you can store objects of different types. But it's important to differentiate them in terms of computer memory. Here are the allowed data types in Python:

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

Let’s not dig deep into all these data types just yet; we won’t need them for now. Instead, we will carefully consider each data type in the following chapters. If you have a variable and you want to check its type, please use the type() function. Do not forget to use the print() function so that Python will print the result for us. For example,

Section 2.

Chapter 4