integer, string, boolean, list, set, tuple — are indeed some of the most common and fundamental data types we use daily in Python.
Example:
int — Integer numbers (e.g., 5, -10)
float — Floating-point numbers / decimals (e.g., 3.14, -0.001)
str — Strings (text) (e.g., "hello", 'Python')
bool — Boolean values (True or False)
list — Ordered, mutable sequences (e.g., [1, 2, 3])
tuple — Ordered, immutable sequences (e.g., (1, 2, 3))
set — Unordered collection of unique items (e.g., {1, 2, 3})
dict — Key-value pairs / mappings (e.g., {'name': 'Alice', 'age': 25})
Immutable Data Types:
Cannot be changed after they are created.
int (e.g., 5)
float (e.g., 3.14)
bool (True or False)
str (e.g., "hello")
tuple (e.g., (1, 2, 3))
frozenset (an immutable version of set, less commonly used)
bytes (immutable sequence of bytes)
Mutable Data Types:
Can be changed/modified after creation.
list (e.g., [1, 2, 3])
set (e.g., {1, 2, 3})
dict (e.g., {'a': 1, 'b': 2})
bytearray (mutable sequence of bytes)
Note:
* For immutable types, if you try to change a value, Python creates a new object instead of modifying the original one.
* For mutable types, you can modify the existing object directly (e.g., adding/removing items in a list).datatypes
Directory actions
More options
Directory actions
More options
datatypes
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||