Variables
Lesson 1 of 3
  1. 1
    In programming, we have a way of storing values so that we can reuse them throughout our program or change them, if necessary. This concept is known as a variable. Maybe you’re familiar with th…
  2. 2
    One reason we use variables is that they allow us to easily reuse values in different parts of our code. When we reuse a value, it will appear in multiple places in our code. Re-typing that val…
  3. 3
    The strong selling point of using a variable is that we can easily change their value, making our programs flexible. As we saw in the last exercise, we can save a number to a variable and reuse i…
  4. 4
    Now that you know a bit about variables, let’s code some ourselves! We create or declare a variable by giving it a name and setting it equal to a value. terrain = ‘lake’ In the code editor,…
  5. 5
    Congrats! Now you’ve learned about variables and why they’re useful in programming. In this lesson, we learned that: - Variables allow us to store information - Variables allow us to quickly _re…

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo