Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python - Conditionals

Total questions: 12

Worksheet time: 9mins

Name
Class
Date
1.

Which code means not equal to?

a)

==

b)

<=

c)

>

d)

!=

2.

Which of the following is not a Relational Operator?

a)

<=

b)

==

c)

=

d)

!=

3.

Which of the following is NOT a Boolean Statement?

a)

name == "duck"

b)

8 <= 12

c)

num = int(Input("Pick a number.")

d)

total > 0

4.

Which booleans have a value of True?

a)

12 - 3 == 9

b)

30 <= 25

c)

17 != 11 + 6

d)

15 / 5 == 3.0

5.

Which of the following are valid values for a boolean?

Select ALL that apply.

a)

True

b)

false

c)

0

d)

False

e)

1

6.

What is the final value for total?

a)

6

b)

4

c)

7

d)

9

7.

Which lines of code will be skipped when the program is run?

a)

4, 7, 8

b)

4

c)

3, 4, 7, 8

d)

7, 8

8.

In the provided code, what is the final value for alarm?

a)

6

b)

7

c)

8

d)

9

9.

Review the provided code. Are there any possible flaws in this programming code.

a)

There are no flaws in the program

b)

A colon, : , is missing from the end of line 2

c)

The value for day could be spelled incorrectly.

d)

The value for day could be entered as a number.

10.

What is the truth value for the compound Boolean statement?

5 == 2 + 3 or 7 > 8

a)

True

b)

False

c)

No Value

11.

In the provided code, what is the final output?

a)

"Fred"

b)

15

c)

25

d)

35

12.

In the provided code, which lines of code will be skipped by the computer when the program is run?

a)

7

b)

7, 10, 11

c)

10, 11

d)

7, 10