Data Types
Python's core built-in types include int (whole numbers), float (decimals), str (text), and bool (True/False). Python also has built-in collection types like list, tuple, and dict, covered in more depth in later topics.
💡 Key insight
Python's int type has no fixed size limit — it can grow to represent arbitrarily large numbers automatically.
Syntax
syntax
int, float, str, bool, list, tuple, dictExample
Each variable's type is inferred automatically from the value assigned to it.
py
age = 20 # int
gpa = 8.9 # float
name = "CodeyHub" # str
passed = True # bool
print(type(age), type(gpa), type(name), type(passed))output<class 'int'> <class 'float'> <class 'str'> <class 'bool'>
Try it yourself
Copy this example into the Python compiler and run it — try changing a value and see what happens.
