2.02
Completed
Variables and Assignment Variables and Assignment

Learn how Python variables work, how assignment stores values, and how to reuse named values in your code.

Variables and Assignment

Sounds useful?

Jump into the interactive version.

No setup. No account. Just Python.

Interactive Python lesson

Variables and Assignment

This Block introduces one of the first truly useful ideas in Python: giving values names. You will learn how variables work, what the assignment operator = really does, and how to store simple values like text, numbers, booleans, and None so you can reuse them later.

Read assignment from right to left, print variable values correctly, avoid mixing up variable names with quoted text, and make sure variables exist before you use them. Small examples keep everything grounded, so variables feel like a normal tool instead of some mysterious programming ritual.

What you will learn:

  • Create variables with clear names
  • Understand how assignment with = works
  • Use variables with print()
  • Tell the difference between name and "name"
  • Assign values before using them
  • Build simple values from other variables
  • Spot common beginner mistakes around reversed assignment and quoted variable names

By the end, you will be able to create small named pieces of data and use them in simple Python programs.

> Start now 105 cards · about 10 min

Ready to practice this in the browser?

> Play now