Variables and Assignment
Learn how Python variables work, how assignment stores values, and how to reuse named values in your code.
Sounds useful?
Jump into the interactive version.
No setup. No account. Just Python.
Variables and Assignment
Learn how Python variables work, how assignment stores values, and how to reuse named values in your code.
Jump into the interactive version.
No setup. No account. Just Python.
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:
= worksprint()name and "name"By the end, you will be able to create small named pieces of data and use them in simple Python programs.
Ready to practice this in the browser?
> Play now