wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Comparison Operators - Python

Total questions: 7

Worksheet time: 5mins

Name
Class
Date
1.

Which symbol is the "greater then" operator in Python?

a)

==

b)

<=

c)

>

d)

!=

2.

Which symbol is the "not equal to" operator in Python?

a)

>=

b)

!=

c)

=

d)

==

3.

What expression will check if age is less than or equal to 18 in Python?

a)

age > 18

b)

age == 18

c)

age != 18

d)

age <= 18

4.

What is the output of this code in Python?

a)

True

b)

False

5.

What is the output of this code in Python?

a)

True

b)

False

6.

Which code will print "Positive" if the number is greater than 0?

a)

b)

c)

d)

7.

What is the output of this code if temperature is 15?

a)

warm

b)

cold