Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Tech Essentials — Chapter 9 Exam (Grade 6)

Total questions: 15

Worksheet time: 9mins

Name
Class
Date
1.

Which Python function is used to gather user input or responses?

a)

input()

b)

gather()

c)

print()

d)

ask()

2.

The Python input function will return a string if the user enters text input and an integer if the user enters numeric input.

a)

True

b)

False

3.

Boolean expressions can only have true or false answers.

a)

True

b)

False

4.

What is "iteration"?

a)

The act of repeating something.

b)

The act of replacing something.

c)

The act of branching decisions.

d)

The act of sequential execution.

5.

When a "for" loop ends, where does the program flow continue?

a)

At the first non-indented statement after the loop body

b)

Program flow resumes at the statement directly above the "for" keyword

c)

The entire program halts immediately when the loop is done

d)

for() loops, by design, will never end

6.

In the code below, which statement(s) are part of the "for" loop body? sum = 0 # LINE 1 for index in range(0,10): # LINE 2 sum = sum + index # LINE 3 print(str(sum)) # LINE 4

a)

LINE 3 only

b)

LINES 2 and 3 only

c)

LINE 1 and 4 only

d)

LINES 1, 2, and 3 only

7.

A "nested loop" is a loop within another loop.

a)

True

b)

False

8.

Which of the following is a valid nested "for" loop in Python?

a)

for i in range(1,5):\n for j in range(6,10):\n print(i)\n print(j)

b)

for i in range(1,5):\n for j in range(6,10):\n print(i)\n print(j)

c)

for i in range(1,5):\n print(i)\n print(j)

d)

for i in range(1,5) and j in range(6,10):\n print(i)\n print(j)

9.

What will be displayed on the screen when the following code is run? data = "count" result = "" for x in data: result = result + x + "#" print(result)

a)

c#o#u#n#t#

b)

count

c)

#t

d)

#####

10.

How do you create nested loops in Blockly?

a)

Place a "Repeat N times" block inside another "Repeat N times" block

b)

You cannot do nested loops in Blockly, only in Python

c)

Place one "Repeat N times" block, then place a second "Repeat N times" block after the first is finished

d)

Place a "Repeat N times" block inside a "Print" block

11.

Indentation is very important when creating "for" loops and "if" and "elif" statements in Python

a)

True

b)

False

12.

Ms. Liao has a cat

a)

True

b)

False

13.

What makes a program "interactive"?

a)

When it provides extra output.

b)

There's no such thing

c)

When it asks for user input as well as providing output

d)

When it only asks for input.

14.

A (a)   is most often associated with Blockly.

15.

(a)   is the healthcare robot in Big Hero 6.