wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

2.1.3 Review

Total questions: 17

Worksheet time: 9mins

Name
Class
Date
1.

What is the difference between a list and a variable?

a)

List are for shopping and a variable is used in math equations

b)

Lists hold multiple pieces of data and a variable only holds one piece of data

c)

Lists allow user to perform multiple tasks at a time and variables are for storing data.

d)

Lists only hold one piece of data and a variables holds multiple pieces of data.

2.

Every list has to have a variable that points to the current element in the list. What do we call this variable?

a)

Pointer

b)

Index

c)

Counter

d)

Loop

3.

How many elements does this list hold?

a)

5

b)

7

c)

9

d)

3

4.

What is the name of this list?

a)

MyList

b)

theList

c)

setList

d)

myList

5.

What is the index value for the value 30 in myList?

a)

7

b)

6

c)

4

d)

5

6.

If index is set to 3 what will be printed on the Brain?

a)

8

b)

3

c)

7

d)

4

7.

What does the block "change index by 1" do?

a)

set the value stored in index to 1

b)

adds one to the value currently stored in index

c)

subtracts one to the value currently stored in index

d)

stored a random number in index

8.

Why is the block "set index to 1" included in this program?

a)

To make the program longer

b)

To confuse any programmer that might work on this later

c)

To make sure the program starts looking at the last element in first_list.

d)

To ensure the programs starts looking at the first element in first_list.

9.

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>?

a)

1

b)

2

c)

3

d)

4

10.

What block of code will need to change to have the loop increment by 2 rather than 1?

a)

set index to 1

b)

set first_list to 8 3 7 4 5 1

c)

while index < 7

d)

change index by 1

11.

Which block of code do you use to initialize a variable>

a)
b)
c)
d)
12.

Both of the sets of blocks will print the same the same element of myList.

a)

True

b)

False

13.

What will be printed on the brain?

a)

60

b)

15

c)

18

d)

35

14.

What will be printed on the brain?

a)

5

b)

10

c)

20

d)

25

15.

Which loop will continue until a specific condition is met?

a)
b)
c)
d)
16.

Which of the following is not one of the four parts of a While Loop

a)

Initialize the counter

b)

Print the counter

c)

Add While Loop

d)

Test the condition

17.

Which blocks would you need to change to have first_list printed backwards (Ex: 154738)

a)
b)
c)
d)