Font size
S
M
L
XL
WorksheetsMatch Exercises
Total questions: 11
Worksheet time: 6mins
Name
Class
Date
1.
What does match do?
a)
Compare a value
b)
Loop
c)
Run the right block
d)
Create functions
2.
Which word starts match statement?
a)
if
b)
case
c)
match
d)
for
3.
Which word starts each choice?
a)
switch
b)
case
c)
if
d)
match
4.
What happens if no case matches?
a)
Error
b)
Python crashes
c)
case _ runs
d)
None
5.
Can you match numbers?
a)
Yes
b)
No
6.
What is used for "default" case?
a)
case 0
b)
case _
c)
case default
d)
case else
7.
Can we use input() with match?
a)
Yes
b)
No
8.
If no case matches, what case is run?
a)
The first one
b)
The last one
c)
case _
9.
Which type can match statement compare?
a)
int
b)
str
c)
bool
d)
list
10.
What operator can you use inside case _ if condition?
a)
>
b)
<
c)
in
d)
All
11.
Can match be used instead of long if-else chains?
a)
Yes
b)
No
Reset
