Lesson 02 – Variables

Saving Information in Code

When we write programs, we often need to remember information. A variable is how we store information inside a program. Think of a variable like a labelled container. The label is the variable name. The value is what is stored inside.
For example:
age = 16
This tells Python:
• Create a variable called age
• Store the number 16 inside it
You can then use the variable later in your code. Example:
age = 16
print(age)
Python will display: 16
Your Task:

1. Create a variable called name
2. Store your name as text
3. Print the variable

Create and print a variable
# Write your code below


← Previous Home Next →