Font size
WorksheetsDomain 2 Multiple Choice Practice
Total questions: 21
Worksheet time: 12mins
_____ are immutable, while ____ are editable and can be changed.
The continue keyword (a) an iteration of a loop.
breaks
skips
ends
repeats
A _____ conditional statement is a statement with two or more conditions.
simple
compound
single
basic
Having one loop run ____ another is called a nested loop.
outside
inside
parallel
separate
Python uses ____ rather than curly brackets to indicate the actions to take for a condition.
indents
spaces
tabs
lines
An ___ statement allows one to set one or more conditions in a decision flow should the if portion of the flow be false.
else
elif
if
switch
The break keyword will ____ a loop.
continue
exit
skip
repeat
Indentation can be done with ___ spaces or the Tab key on the keyboard, but the method chosen must be consistent.
two
three
four
five
A loop that runs when conditions are true or false is known as a (a) loop.
for
while
do-while
repeat
A for loop is designed to ___ over a sequence, collection, or data structure.
iterate
skip
jump
run
The pass keyword acts as a(n) _______ , allowing a framework to be built and run even when one needs more information to complete code.
placeholder
marker
symbol
sign
Which keyword is used to define a function in Python?
func
def
define
function
What is the output of the expression 3 + 2 * 2 in Python?
9
8
7
10
Match the following data types with their descriptions in Python.
float
Used to store decimal numbers
int
Used to store whole numbers
str
Used to store a sequence of characters
list
Used to store a collection of items
Which keyword is used to import a module in Python?
load
require
import
include
What is the result of the expression 5 // 2 in Python?
2.5
2
2.0
3
The data type used to store a collection of key-value pairs in Python is (a)
set
dictionary
tuple
list
Match the following functions with their purpose in Python.
count()
Function to count occurrences of an element in a list.
len()
Function to get the length of a list.
type()
returns the data type of a variable
print()
shows a specific output in the console
The result of the expression 10 % 3 in Python is (a)
3
0
Which function is used to convert a string to an integer in Python?
convert()
int()
str()
float()
Match the vocabulary with the BEST example!
[1, 2, 3, 4, 5]
List
(1, 2, 3, 4, 5)
Tuple
{1, 2, 3, 4, 5}
Set
{'1':'2', '3':'4'}
Dictionary
'[1, 2, 3, 4, 5]'
String
