Return to Video

Unplugged - Variables in Envelopes

  • 0:23 - 0:26
    This lesson is called variables in envelopes.
  • 0:26 - 0:30
    We're going to learn how we can build sentences when we're still missing pieces of information.
  • 0:30 - 0:34
    Most of us are already familiar with the idea of filling in a blank.
  • 0:34 - 0:37
    We do it when we're
    putting our name on our homework.
  • 0:37 - 0:41
    Sometimes, there's more than one blank that needs to be filled out, and in that case,
  • 0:42 - 0:46
    we give the blank a label so that we know which piece
    of information goes where.
  • 0:47 - 0:51
    Variables are placeholders for pieces of information that can change.
  • 0:51 - 0:56
    By using a variable for the missing information, we can continue working on whatever we were doing,
  • 0:56 - 1:00
    and let someone else fill in information later.
  • 1:00 - 1:02
    In software, we use variables a lot.
  • 1:03 - 1:07
    We use variables as placeholders for name, email address, and even username.
  • 1:07 - 1:10
    That way, we can let the program know where those details will appear
  • 1:10 - 1:12
    after the user fills them in.
  • 1:13 - 1:15
    We use variables all the time in our work.
  • 1:15 - 1:20
    Any time you need to store a piece of information
    for later, we use a variable. Let's say we
  • 1:21 - 1:24
    Let's say we need to count the number of times the user has tweeted.
  • 1:26 - 1:29
    Every time that user tweets, we'll add one to that number.
  • 1:29 - 1:32
    And every time
    the user deletes a tweet, we'll decrease that number by one.
  • 1:33 - 1:36
    Anytime we need to know how
    many times that user has tweeted,
  • 1:36 - 1:38
    we'll just look at that variable.
Title:
Unplugged - Variables in Envelopes
Video Language:
English
Duration:
01:43

English subtitles

Revisions