Python Data Types - Part 1

Python Data Types

● Python has a number of built-in data types that can be used to store data. 

● A data type is the type of data that is stored in a variable.  

● A variable is simply a reserved memory location where values can be stored. 

● Python has 14 data types that are classified into various categories.

No alt text provided for this image

For example, We've created a variable named "num" to which you've assigned the value of "10". In Python, everything is an object. When "num = 10" is executed, the Python environment creates an "integer object 10" in memory and assigns its reference to the variable "num". So, the variable "num" refers to the "int object 10". Where is it stored once it becomes an object? What is the object's location? The "object 10" is stored in a reserved memory location with a unique address. What data type is this? The value "10" stored in the "num" variable is of the "int" type. 

You can get the data type, id (address), and value by calling "num".

No alt text provided for this image



To view or add a comment, sign in

More articles by Siva Velivelli

  • Python Keywords

    Python Keywords: ● In Python, the reserved words are called "keywords". They define Python's syntax and structure.

  • Python Identifiers

    Python Identifiers: ● In Python programming, a name is referred to as an identifier. It could be a Class Name, a…

    1 Comment
  • Python Features

    @author: Siva Velivelli Python Features 1. Simple and easy to learn: ● The statements in the Python program look like…

  • How does the Python interpreter work?

    @author: Siva Velivelli How does the Python interpreter work? ● When we run source code (a file with a .py extension)…

  • Python Introduction and Applications

    @author: Siva Velivelli Python Introduction 1. Python is a general-purpose, high-level, and interpreted programming…

Explore content categories