Tutorial 5: Bearcu Remembers

Learning Goal: Variables

Variables let your program remember information! They're like labeled boxes where you can store values and update them as your program runs.

You create a variable with = and can change its value anytime:

score = 0          # Create a variable
score = score + 1  # Add 1 to it
score += 1         # Shorthand for adding 1

Variables can store numbers, text, True/False values, and more:

count = 10             # Number
name = "Bearcu"        # Text (string)
is_happy = True        # Boolean
count = count + 5      # Now count is 15

Tutorial 5: Bearcu Remembers

Bearcu found honey jars! Collect all 3 honey jars and reach the star. Use a variable to keep track of how many you've collected. Variables store values that you can change as your program runs. Use bearcu.pick_up() to collect honey, and increment your counter each time!

Initializing Python environment...

Loading grid...

What You Learned

  • Variables store values that can change
  • Use = to assign or update a variable
  • count += 1 is shorthand for count = count + 1
  • Variables help you track state as your program runs
  • Good variable names describe what they store

Congratulations!

You've completed all 5 Bearcu tutorials! You've learned the fundamental building blocks of programming:

  • Sequences: Running commands in order
  • Loops: Repeating code efficiently
  • Conditionals: Making decisions
  • Functions: Reusing code
  • Variables: Storing and updating information

These concepts work the same way in every programming language. Now you're ready to build amazing things!