IT 116: Introduction to Scripting
Class 7 Ungraded Quiz
-
Write an
if
statement that prints "Too big" if the value
of the variable number is greater than 100.
-
What are the only values that a boolean expression can have?
-
Write the Python boolean literals.
-
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.
-
Write an
if
statement that prints "Too big" if the value of the variable
numb is greater than 1000.
-
Write an
if
/else
statement that prints
"Positive" if the value of the variable numb
is greater than or equal to 0, and prints "Negative" if it is not.
-
Write an
if
/elif
/else
statement that prints
"Positive" if the value of the variable numb
is greater than 0, and prints "Negative" if it is less than 0 and
print "Zero" otherwise.
-
If you typed the following in the Python interactive mode,
what would the result be?
"foo" < "bar"
-
If you typed the following in the Python interactive mode,
what would the result be?
sam == Sam
-
If you typed the following in the Python interactive mode,
what would the result be?
5 != 6