Skip to content
dreamcode
dreamcode
Map
Variables
Lesson 1 of 77
+15 XP on finish
PYTHON BASICSChapter 1 · Python Basics

Boxes with names

A variable is a name you give to a value so you can use it again. Write the name, an equals sign, then the value. From then on the name stands in for the value.

Worked example

How it reads

  • sky = "wide open" stores the text on the right under the name sky
  • The name goes on the left, the value on the right of the =
  • print(sky) shows whatever sky is holding right now
Cloud tip: An = in Python means "put this value into this name". It is not the equals from math.
main.py
PYTHON
real Python, runs in your browser
Console
Run your code to see its output here.
YOUR TURN

Add a third variable place holding "the roof" and print it last, so the output ends with the roof.

Press Run to check your work.