Skip to main content
Submitted by admin on 27 December 2021

Data types are used to specify the type of data while storing. Every variable is associated with a data type.

Notetype()function is used to determine the type of data type.

1. Primitive Data Type( Built-in Datatype)

Primitive data types are referred to as in-built data types and are in the form of keyword for particular language.

Primitive data types are also immutable, meaning that they can not be changed after they are created.

There are 5 types of Primitive Data Type as listed below.
Integers, Floats, Strings, Booleans, complex numbers
1. Integers
This value is represented by int class. It contains positive or negative whole numbers (without fraction or decimal). In Python there is no limit to how long an integer value can be.
2. Float
This value is represented by float class. It is a real number with floating point representation. It is specified by a decimal point. Optionally, the character e or E followed by a positive or negative integer may be appended to specify scientific notation.
3. Complex Numbers
Complex number is represented by complex class. It is specified as (real part) + (imaginary part)j. For example – 2+3j
4. Strings
Complex number is represented by complex class. It is specified as (real part) + (imaginary part)j. For example – 2+3j
5. Booleans
Complex number is represented by complex class. It is specified as (real part) + (imaginary part)j. For example – 2+3j

2. Non-primitive Data Type( user defined Datatype)

Non-primitive data types are also mutable, meaning that they can be changed after they are created.

As they are user-defined data types, there is no specific count. It may vary depending on the requirement because we also create your own custom. The most common usage is as below.
Lists, Tuples, Dictionaries, Sets or [your custom data type]