Overview
Variables data store karne ke containers hain bhai. Python mein int, float, str, bool — ye sab types hain.
Analogy
Variable ek labelled dabba hai — label naam hai, andar ka saman value hai.
Step-by-step
- Meaningful naam choose karo
- = se value assign karo
- Python automatically type detect kar leta hai
- Different type se reassign bhi kar sakte ho
Visual
age = 25 # int
height = 1.75 # float
name = "Alice" # str
active = True # bool
Common mistakes
- Variable name mein space daal dena
- = (assign) aur == (compare) ka confusion
- Text ke liye quotes bhool jaana
Practice questions
- Naam, umar, height ke variables banao
- type() se type check karo