Named Variable

Created by the programmer (that is you)

Think of a named variable as a bucket that you put on your desk that will hold a value. Throughout your program you will refer to that value by its name.

size  = 8

//where size is the name of my variable and it is storing the value 8

see size * 5

//find the output on your screen

Now time to create a program that uses the variable

dot black, size * 5

dot red,   size * 4

dot black, size * 3

dot red,   size * 2

dot black, size

//why no size * 1?

Now: Change the value stored in size to 2 and then 20. How does this change the output?

Network Notebook: Write a 1 sentence defintion of a named variable in your own words (can't use the bucket I already did that). Explain what happened to the code when you change the value stored. Consider that to make the bullseye larger, we only had to change the value one time.

Last updated