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.
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".