IT 116: Introduction to Scripting
Quiz 3 Answers
-
What are the only values that a boolean expression can have?
True and False
-
Write the Python boolean literals.
True and False
-
Write the boolean expression that is true if the value of the variable number_1
is greater than or equal to value of the variable number_2.
number_1 >= number_2
-
If you typed the following in the Python interactive mode,
what would the result be?
5 != 6
True
-
Write a Python expression that evaluates to
True if the variable
whose name is num has a value greater than 0 and less than 10.
num > 0 and num < 10
-
What is the data type of the variable whose name is value_good
that is created by the following statement?
value_good = num > 0
boolean
-
What is the boolean value of the following expression?
not 5
False
-
If you typed the following in Python's interactive mode,
what would the result be?
not False
True
-
If you typed the following in the Python interactive mode,
what would the result be?
True and False
False
-
If you typed the following in Python's interactive mode,
what would the result be?
True or False
True