Variables & Data Types
📦 Topic 02 · Data
Variables & Data Types
Learn how Python stores and organises data using variables, and explore the core built-in types you'll use in every program.
⏱ ~35 min
🟢 Beginner
💡 Core concept
What is a Variable?
A variable is a named container that holds a value. In Python you create one simply by assigning to it — no type declaration required. Python figures out the type automatically (this is called dynamic typing).
📌 Naming Rules
Names must start with a letter or underscore, contain only letters/numbers/underscores, and are case-sensitive. my_var and My_Var are different variables.
Core Data Types
Python has several built-in types. Use type() to inspect any value at runtime.
Type Conversion
Convert between types using built-in functions: int(), float(), str(), bool().
Multiple Assignment
Python supports concise multiple assignment on one line — handy for unpacking and swapping values without a temp variable.