wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

G11 FT Quiz 1 - Python Conditions

Total questions: 10

Worksheet time: 7mins

Name
Class
Date
1.

An "if statement" is written by using the IF keyword.

a)

True

b)

False

2.

The _____ keyword is Python's way of saying "if the previous conditions were not true, then try this condition".

a)

if

b)

elif

c)

else

d)

ifelse

3.

The ____ keyword catches anything which isn't caught by the preceding conditions.

a)

if

b)

elif

c)

else

d)

ifelse

4.

You can also have an else without the elif:

a)

True

b)

False

5.

The ____ keyword is a logical operator, and is used to combine conditional statements. Both statements should be true.

a)

and

b)

or

c)

not

d)

exor

6.

The ____ keyword is a logical operator, and is used to combine conditional statements. At least one statement should be true.

a)

and

b)

or

c)

not

d)

exor

7.

The ____ keyword is a logical operator, and is used to reverse the result of the conditional statement:

a)

and

b)

or

c)

not

d)

exor

8.

What is the output of the following code?

a)

True

b)

False

c)

Error

d)

Blank

9.

What is the output of the following code?

a)

True

b)

False

c)

Error

d)

Blank

10.

What is the output of the following code?

a)

b is not greater than a

b)

b is greater than a

c)

Error

d)

Blank