Code

Give It a Name

A variable is a name that remembers a value, like a label stuck on a jar. You create one with a single = sign:

guide = "Pip"
lanterns = 7

Read = as "store": store "Pip" under the name guide. Now you can use the name anywhere instead of the value:

print(guide)               # Pip
print("Guide:", guide)     # Guide: Pip
print("Lanterns:", lanterns)  # Lanterns: 7

Notice: guide has no quotes, so Python looks up what's inside the jar. "guide" with quotes would just print the word guide.

You can give print several things separated by commas; it shows them in order with a space between each.

Name rules: use lowercase letters, digits and _ (like oil_left), and don't start with a digit.

Assignment

  1. Create a variable island that stores the text "Emberreach".
  2. Create a variable lanterns that stores the number 3 (no quotes).
  3. Print them using commas so the output is exactly:
Island: Emberreach
Lanterns: 3