Python has several built-in data types that are essential for programming. Here's a quick overview:
1. Primitive Data Types 📌
- Integer
int
: Represents whole numbers (e.g.,10
,-5
). - Float
float
: Stores decimal numbers (e.g.,3.14
,-0.001
). - String
str
: Sequence of characters (e.g.,"Hello, World!"
). - Boolean
bool
: Logical valuesTrue
orFalse
.
2. Composite Data Types 📦
- List
list
: Ordered, mutable collection (e.g.,[1, 2, 3]
). - Tuple
tuple
: Ordered, immutable collection (e.g.,(1, 2, 3)
). - Dictionary
dict
: Key-value pairs (e.g.,{"name": "Alice"}
). - Set
set
: Unordered, unique elements (e.g.,{1, 2, 3}
).
3. Special Data Types 🔍
- NoneType: Represents absence of a value.
- Bytes: Binary data (e.g.,
b'hello'
). - Range: Sequence of numbers (e.g.,
range(1, 5)
).
For more details on Python basics, visit our Python Introduction Tutorial. 🚀