Introduction
Primitive data types in Python are the basic building blocks used to store simple values. These include integers, floats, strings, booleans, and NoneType. Each type serves a specific purpose, such as performing arithmetic operations, representing text, or handling logical conditions. Since Python is dynamically typed, variables do not need explicit type declarations.

In this article, you will learn about different primitive data types, their properties, and how they are used in Python programming.
What are Primitive Data Types in Python?
Primitive data types are the basic building blocks of data in Python. These data types hold simple values and are stored in memory efficiently. Python has several primitive data types:
- Integer (int) – Represents whole numbers
- Float (float) – Represents decimal numbers
- Boolean (bool) – Represents True or False values
- String (str) – Represents sequences of characters
- Complex (complex) – Represents complex numbers
Each of these data types has specific characteristics and use cases, which we will discuss with examples.
1. Integer (int)
Integers are whole numbers that can be positive, negative, or zero.
Example
num = 10
print(type(num))
print(num)
Output:
<class 'int'>
102. Float (float)
Floats are numbers with decimal points or in exponential form.
Example
pi_value = 3.14159
print(type(pi_value))
print(pi_value)
Output
<class 'float'>
3.141593. Boolean (bool)
Boolean values represent truth values: True or False.
Example
is_python_fun = True
print(type(is_python_fun))
print(is_python_fun)
Output:
<class 'bool'>
True4. String (str)
Strings are sequences of characters enclosed in single, double, or triple quotes.
Example
message = "Hello, Python!"
print(type(message))
print(message)
Output
<class 'str'>
Hello, Python!5. Complex (complex)
Complex numbers consist of a real and imaginary part.
Example
complex_num = 2 + 3j
print(type(complex_num))
print(complex_num)
Output:
<class 'complex'>
(2+3j)




