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

Practice Exercises

  1. Create variables name, age, and city
  2. Print them in one line