Font size
Worksheets2.3 Programming Data Review
Total questions: 16
Worksheet time: 9mins
Which of the following is the BEST example of a variable name?
a1
x
high_score
123score
What is the main purpose of a variable in programming?
To store data
To print data
To delete data
To sort data
Which of the following would be considered a constant?
Number of goals scored in a game
Today’s lunch menu
The value of pi (3.14159)
A student’s daily attendance count
A variable that does not change during a program is called a (a) .
A variable can only change once in a program.
True
False
What is the difference between a variable and a constant?
A constant never changes, but a variable can
A variable never changes, but a constant can
Both can change values
Constants are always numbers, variables are words
Which of these is NOT a good variable name?
total_points
playerLives
score2
thing
In the our example, “spread peanut butter” would be considered a _______.
Variable
Constant
Function
Container
Why do programmers use functions?
To make code longer
To break complex tasks into smaller steps
To erase data
To rename variables
Which of the following is an example of an array?
high_score = 500
snacks = ["Chips", "Cookies", "Candy"]
gravity = 9.8
make_sandwich()
What is the FIRST element of the array pets = ["Dog", "Cat", "Fish"]?
"Cat"
"Dog"
"Fish"
pets[3]
In most programming languages, what index number does the first element of an array start at?
1
0
-1
10
Which Python structure is most similar to an array?
Loop
List
Constant
Function
What would scores[2] return if scores = [10, 20, 30, 40]?
10
20
30
40
Which of the following is an advantage of using arrays/containers?
They make code shorter and more organized.
They delete unused variables.
They can only hold one number.
They automatically sort data.
What is a vector in programming?
Another name for a constant
A special type of array
A type of function
A mathematical equation only
