Data types in Python or Different Types of Objects in Python

In Python, everything is treated as an object or instance of an object. So depending on the nature of the objects the instances behave. Accordingly, the nature of data types the data types are categorized into Mutable and Immutable data types.

Every variable in python holds an instance of an object. There are two types of objects in python i.e. Mutable and Immutable objects. Whenever an object is instantiated, it is assigned a unique object id. The type of the object is defined at the runtime and it can’t be changed afterward. However, it’s the state can be changed if it is a mutable object.

To summarise the difference, mutable objects can change their state or contents and immutable objects can’t change their state or content.

Read the post Difference between mutable and immutable data types.

Data Types in Python

There are many data types in python we have discussed a few mostly used data types in this post as mention below table.

ClassDescription Immutable?
boolBoolean ValueYes
floatFloating point numberYes
listThe mutable sequence of objects
tupleImmutable sequence of objectsYes
strunorder set of distinct objects
forzensetImmutable form of set classYes
dictAssocestive mapping

Send a Message