Notes / Python / Data Types

Data Types in Python — Revision Notes

A quick-reference cheat sheet: definition, syntax, example, common mistakes and an interview tip.

beginner 📖 2 min revision

Definition

📌 Data Types Python's core built-in types include int (whole numbers), float (decimals), str (text), and bool (True/False).

Syntax

syntax
int, float, str, bool, list, tuple, dict

Example

py
age = 20            # int
gpa = 8.9           # float
name = "CodeyHub"   # str
passed = True        # bool

print(type(age), type(gpa), type(name), type(passed))

Output

output<class 'int'> <class 'float'> <class 'str'> <class 'bool'>

Important Points

Common Mistakes

Interview Tip

🎯 Before your interview Know that Python's dynamic typing doesn't mean "no types" — every value has a concrete type, checked at runtime rather than declared upfront.
Back to notes Read full lesson →