What are Data Types and Variables?

In this lesson, we'll learn about the different data types in Python.

Definition

The data type of an item defines the type and range of values that item can have.

The concept of data types can be found in the real world. There are numbers, alphabets, characters, etc., that all have unique properties due to their classification.

Such a classification is also made in many programming languages, including Python.

Python’s Data Types

Unlike many other languages, Python does not place a strong emphasis on defining the data type of an object, which makes coding much simpler. The language provides three main data types:

  • Numbers

  • Strings

  • Booleans

Variables

A variable is simply a name to which a value can be assigned.

Variables allow us to give meaningful names to data.

The simplest way to assign a value to a variable is through the = operator.

Get hands-on with 1000+ tech skills courses.