Font size
Worksheets2.1.3 Review
Total questions: 17
Worksheet time: 9mins
What is the difference between a list and a variable?
List are for shopping and a variable is used in math equations
Lists hold multiple pieces of data and a variable only holds one piece of data
Lists allow user to perform multiple tasks at a time and variables are for storing data.
Lists only hold one piece of data and a variables holds multiple pieces of data.
Every list has to have a variable that points to the current element in the list. What do we call this variable?
Pointer
Index
Counter
Loop
How many elements does this list hold?
5
7
9
3
What is the name of this list?
MyList
theList
setList
myList
What is the index value for the value 30 in myList?
7
6
4
5
If index is set to 3 what will be printed on the Brain?
8
3
7
4
What does the block "change index by 1" do?
set the value stored in index to 1
adds one to the value currently stored in index
subtracts one to the value currently stored in index
stored a random number in index
Why is the block "set index to 1" included in this program?
To make the program longer
To confuse any programmer that might work on this later
To make sure the program starts looking at the last element in first_list.
To ensure the programs starts looking at the first element in first_list.
Notice that the green comparison block is not completely filled in. What number should be typed in the empty spot to make sure we look at all the elements of the list but not go past the end of the list>?
1
2
3
4
What block of code will need to change to have the loop increment by 2 rather than 1?
set index to 1
set first_list to 8 3 7 4 5 1
while index < 7
change index by 1
Which block of code do you use to initialize a variable>
Both of the sets of blocks will print the same the same element of myList.
True
False
What will be printed on the brain?
60
15
18
35
What will be printed on the brain?
5
10
20
25
Which loop will continue until a specific condition is met?
Which of the following is not one of the four parts of a While Loop
Initialize the counter
Print the counter
Add While Loop
Test the condition
Which blocks would you need to change to have first_list printed backwards (Ex: 154738)
