wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Domain 2 Multiple Choice Practice

Total questions: 21

Worksheet time: 12mins

Name
Class
Date
1.

_____ are immutable, while ____ are editable and can be changed.

a)
Tuples can be changed; lists are immutable.
b)
Tuples are immutable; lists are editable.
c)
Tuples and lists are both mutable.
d)
Tuples are editable; lists are fixed.
2.

The continue keyword (a)   an iteration of a loop.

Choose from the below words

breaks

skips

ends

repeats

3.

A _____ conditional statement is a statement with two or more conditions.

a)

simple

b)

compound

c)

single

d)

basic

4.

Having one loop run ____ another is called a nested loop.

a)

outside

b)

inside

c)

parallel

d)

separate

5.

Python uses ____ rather than curly brackets to indicate the actions to take for a condition.

a)

indents

b)

spaces

c)

tabs

d)

lines

6.

An ___ statement allows one to set one or more conditions in a decision flow should the if portion of the flow be false.

a)

else

b)

elif

c)

if

d)

switch

7.

The break keyword will ____ a loop.

a)

continue

b)

exit

c)

skip

d)

repeat

8.

Indentation can be done with ___ spaces or the Tab key on the keyboard, but the method chosen must be consistent.

a)

two

b)

three

c)

four

d)

five

9.

A loop that runs when conditions are true or false is known as a (a)   loop.

Choose from the below words

for

while

do-while

repeat

10.

A for loop is designed to ___ over a sequence, collection, or data structure.

a)

iterate

b)

skip

c)

jump

d)

run

11.

The pass keyword acts as a(n) _______ , allowing a framework to be built and run even when one needs more information to complete code.

a)

placeholder

b)

marker

c)

symbol

d)

sign

12.

Which keyword is used to define a function in Python?

a)

func

b)

def

c)

define

d)

function

13.

What is the output of the expression 3 + 2 * 2 in Python?

a)

9

b)

8

c)

7

d)

10

14.

Match the following data types with their descriptions in Python.

a)

float

1.

Used to store decimal numbers

b)

int

2.

Used to store whole numbers

c)

str

3.

Used to store a sequence of characters

d)

list

4.

Used to store a collection of items

15.

Which keyword is used to import a module in Python?

a)

load

b)

require

c)

import

d)

include

16.

What is the result of the expression 5 // 2 in Python?

a)

2.5

b)

2

c)

2.0

d)

3

17.

The data type used to store a collection of key-value pairs in Python is (a)  

Choose from the below words

set

dictionary

tuple

list

18.

Match the following functions with their purpose in Python.

a)

count()

1.

Function to count occurrences of an element in a list.

b)

len()

2.

Function to get the length of a list.

c)

type()

3.

returns the data type of a variable

d)

print()

4.

shows a specific output in the console

19.

The result of the expression 10 % 3 in Python is (a)  

Choose from the below words

3

1

0

2
20.

Which function is used to convert a string to an integer in Python?

a)

convert()

b)

int()

c)

str()

d)

float()

21.

Match the vocabulary with the BEST example!

a)

[1, 2, 3, 4, 5]

1.

List

b)

(1, 2, 3, 4, 5)

2.

Tuple

c)

{1, 2, 3, 4, 5}

3.

Set

d)

{'1':'2', '3':'4'}

4.

Dictionary

e)

'[1, 2, 3, 4, 5]'

5.

String