WorksheetsPython Level 1 - Quiz #3
Total questions: 9
Worksheet time: 5mins
True or False: Python allows you to compare strings, but it is not case sensitive.
True
False
True or False: In Python, True and true mean the same thing
True
False
What’s the output of the following code:
print(5 > 2 and 5 < 3)
True
False
What’s the output of the following code:
foo
bar
foobar
Which of the following is the correct ‘if’ clause to determine whether y is in the range 10 through 50, inclusive?
if 10 < y or y > 50:
if y >= 10 or y <= 50:
if 10 > y and y < 50:
if y >= 10 and y <= 50:
What is the result of the following Boolean expression given that
x = 5, y = 3, z = 8?
x < z or z > x
True
False
8
5
Which of the following is the correct ‘if’ clause to determine whether ‘choice’ is a number other than 10?
if choice <> 10:
if choice < 10 or choice > 10:
if choice != 10:
if choice == 10:
In Python, the ____ symbol is used as the not-equal-to operator.
<>
==
!=
<=
What will be the output of the following Python code?
print(1>2)
True
False
1
1>2
