SyntaxStudy
Sign Up
Python Beginner 7 min read

Python Variables

Python Variables

Variables in Python are dynamically typed — you do not declare a type.

Variable Rules

  • Start with a letter or underscore
  • Case-sensitive
  • Cannot use reserved keywords
name = "Alice"
age = 30
pi = 3.14
is_active = True
print(name, age, pi, is_active)

Multiple Assignment

x = y = z = 0
a, b, c = 1, 2, 3
Pro Tip

Use type(var) to check a variable's data type at runtime.