wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python Level 1 - Quiz #3

Total questions: 9

Worksheet time: 5mins

Name
Class
Date
1.

True or False: Python allows you to compare strings, but it is not case sensitive.

a)

True

b)

False

2.

True or False: In Python, True and true mean the same thing

a)

True

b)

False

3.

What’s the output of the following code:


print(5 > 2 and 5 < 3)

a)

True

b)

False

4.

What’s the output of the following code:

a)

foo

b)

bar

c)

foobar

5.

Which of the following is the correct ‘if’ clause to determine whether y is in the range 10 through 50, inclusive?

a)

if 10 < y or y > 50:

b)

if y >= 10 or y <= 50:

c)

if 10 > y and y < 50:

d)

if y >= 10 and y <= 50:

6.

What is the result of the following Boolean expression given that

x = 5, y = 3, z = 8?


x < z or z > x

a)

True

b)

False

c)

8

d)

5

7.

Which of the following is the correct ‘if’ clause to determine whether ‘choice’ is a number other than 10?

a)

if choice <> 10:

b)

if choice < 10 or choice > 10:

c)

if choice != 10:

d)

if choice == 10:

8.

In Python, the ____ symbol is used as the not-equal-to operator.

a)

<>

b)

==

c)

!=

d)

<=

9.

What will be the output of the following Python code?

print(1>2)

a)

True

b)

False

c)

1

d)

1>2