Font size
WorksheetsSelection in Python
Total questions: 15
Worksheet time: 8mins
Which one is a valid example of selection?
if
x = 1
=
What is else if denoted as in Python?
elif
elseif
eli
if:
Which one is NOT a comparison operator
!=
=
==
<=
a = 1
if a != 1:
Is this true or false?
True
False
What will this code print?
Type and enter your answer
(a)
What will this code output when the data you enter is 100?
Syntax error
target hit
target missed
Nothing (null)
Select all the correct logical operators
and
for
or
not
2 == 3
True
False
21 <= 20
True
False
What will this code output if I enter the integer 9999
syntax error
9999
You cannot play games
You can play games
What will this code output?
equal
not equal
10
Syntax error
Enter the number of comparison operators in this code
(a)
Select the relevant description for else if
We would use else if for more than two selection conditions.
We would use else if for only one selection condition
We would use else if for calculating the modulus of a division
We would use else if as a type of iteration
Type the LINE number that has a syntax error
(Line number is on the left of the code snippet)
(a)
What will this code output?
access granted
access denied
syntax error
password
