wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Codesters - Concept Review

Total questions: 30

Worksheet time: 31mins

Name
Class
Date
1.

Shape sprites require multiple arguments, each of which must be in a specific order and of the correct data type.

a)

True

b)

False

2.

Which of the following is a string?

a)

50

b)

o

c)

"50"

d)

50.0

3.

Select the integer:

a)

50

b)

5o

c)

58.0

d)

"50"

4.

Select the float:

a)

50

b)

50.0

c)

"50"

d)

5o

5.

The syntax for assigning actions to specific sprites is called

a)

dot variables

b)

dot notation

c)

variable notation

d)

variable assignment

6.

What will happen when we run this program?

a)

tom will move up 100 pixels

b)

jerry will move up 100 pixels

c)

syntax error: sprite is not defined

d)

sprite will move up 100 pixels

7.

How should we make the astronaut move up?

a)

change jerry to sprite

b)

change sprite.move_up() to jerry.move_up()

c)

change sprite.move_up() to tom.move_up()

d)

change sprite.move_up() to astronaut1.move_up()

8.

Changing the value of a variable will change its value wherever the variable is used.

a)

True

b)

False

9.

What is the value of interest?

a)

6

b)

9

c)

27

d)

33

10.

What is the value of area?

a)

250

b)

10

c)

This will cause a logic error

d)

This will cause a syntax error

11.

User input is always a string

a)

True

b)

False

12.

What command would be used to cast (convert) user input to an integer?

a)

str()

b)

float()

c)

integer()

d)

int()

13.

How do you create a comment in Python?

a)

Place ** at the beginning of the line

b)

Place \\ at the beginning of the line

c)

Place # at the beginning of the line

d)

Place "" at the beginning of the line

14.

What would happen when you run this code?

a)

Syntax error: the range must be greater than 0

b)

Logic Error: the loop runs 0 times

15.

What is the value of x and the value of the sprite's x-coordinate when the loop finishes running?

a)

x = 0, the sprite's x-coordinate = 0

b)

x = 0, the sprite's x-coordinate = 100

c)

x = 100, the sprite's x-coordinate = 100

d)

x = 100, the sprite's x-coordinate = 0

16.

What is the value of x and the value of the sprite's x-coordinate when the loop finishes running?

a)

x = 0, the sprite's x-coordinate = 0

b)

x = 100, the sprite's x-coordinate = 90

c)

x = 100, the sprite's x-coordinate = 100

d)

x = 100, the sprite's x-coordinate = 110

17.

The user enters 25. What happens next?

a)

The sprite says "That's right!"

b)

The sprite says "Hmm....try again!"

18.

Which line of code would correct the logic error, so that when the user enters 25 the sprite says "That's right!"

a)

answer = sprite.ask.int("What is 5 * 5?")

b)

answer = int(sprite.ask("what is 5 * 5?")

c)

if answer == int(25)

d)

int(answer) = sprite.ask("What is 5 * 5?")

19.

What happens if the user enters 12?

a)

The sprite says "Can't wait to vote!"

b)

The sprite says "Not quite ready to retire yet..."

c)

the sprite says nothing

d)

The sprite says both

20.

What happens if the user enters 12?

a)

The sprite says "Can't wait to vote!"

b)

The sprite says "Not quite ready to retire yet..."

c)

the sprite says nothing

d)

The sprite says both

21.

What happens if the user enters maybe?

a)

The if block runs

b)

the elif block runs

c)

The program throws a syntax error

d)

Logic error; nothing happens

22.

How can we solve the logic error caused by users entering something other than yes or no?

a)

Add an else statement

b)

Add more elif statements to test more user input options

23.

Why does the user only get feedback once, even though they are asked to guess three times?

a)

The conditionals are not properly nested inside the loop

b)

They do get feedback 3 times, but it's always the same feedback

24.

rand_num = 5. The user enters 1, 10, and 6. What feedback do they receive?

a)

The sprite says "Too low", then "Too high", then "Too high"

b)

The sprite says "Too low" once

c)

The sprite says "Too high" once

d)

The sprite says "Too high" three times

25.

Do any of these lists contain only one item? (HINT: Pay attention to COMMAS!)

a)

No, all of these lists have more than one item

b)

list_1

c)

list_2

d)

list_4

26.

What happens if you run this loop?

a)

The sprite moves up and down the same amount every time the loop runs

b)

The sprite moves up and down; increasing by 10 each time through the loop

c)

Logic error; the sprite does not move

d)

Syntax error; incorrect data type for move commands

27.

What are the values of min, max, and count_62?

a)

72, 42, 2

b)

42, 72, 0

c)

42, 72, 2

d)

72, 42, 0

28.

What line of code could be used to calculate the average value of list?

a)

average = sum(list)/list.count(list)

b)

average = sum(list)/len(list)

c)

average = len(list)/sum(list)

d)

average = avg(list)

29.

What will happen if the user clicks on megan?

a)

syntax error on line 21

b)

Logic error: jackson says both line

c)

syntax error on line 23

d)

megan says Hello Jackson, the stage changes color jackson says Hello Megan!

30.

Objects can be placed on the stage using a coordinate plane. The origin of this plane is where the x & y axis meet

a)

True

b)

False