beginnerPython
Previous
What are variables in Python?
Next
What is the difference between mutable and immutable objects?
What are the built-in data types in Python?
Answer
Clear, interview-ready explanation
Python provides several built-in data types:
| Category | Data types |
|---|---|
| Text |
str
|
| Numeric |
int, float, complex
|
| Sequence |
list, tuple, range
|
| Mapping |
dict
|
| Set |
set, frozenset
|
| Boolean |
bool
|
| Binary |
bytes, bytearray, memoryview
|
| Null value |
NoneType
|
Example:
name = "Python" # str
age = 25 # int
price = 99.50 # float
number = 2 + 3j # complex
languages = ["Python", "PHP"] # list
coordinates = (10, 20) # tuple
numbers = range(5) # range
student = {"name": "Aman", "age": 25} # dict
unique_numbers = {1, 2, 3} # set
is_active = True # bool
result = None # NoneType