Variables in Python
Variables are used to store data in Python programs. Python uses dynamic typing, meaning variable types can change during runtime.
💡 Variables do not need explicit type declarations in Python.
Creating Variables
x = 10
name = "Khushi"
a, b = 1, 2
x = "now a string"
print(x, name, a, b)
Common Mistakes
❌ Using reserved keywords as variable names
❌ Confusing local and global variables
❌ Confusing local and global variables
Practice Exercises
- Create variables
name,age, andcity - Print them in one line