Chapter 7 Flashcards
TF
A simple decision can be implemented with an if statement.
True
TF
In Python conditions, ≠ is written as /=.
False
TF
Strings are compared by lexicographic ordering.
True
TF
A two-way decision is implemented using an if-elif statement.
False
TF
The math.sqrt function cannot computer the square root or a negative number.
False
TF
A single try statement can catch multiple kinds of errors.
True
TF
Multi-way decisions must be handled by nesting multiple if-else statements.
False
TF
There is usually only one correct solution to a problem involving decision structures.
False
TF
The condition x <= y <= z is allowed in Python.
True
TF
Input validation means prompting a user when input is required.
False
A statement that controls the execution of other statements is called a
control structure
The best structure for implementing a multi-way decision in Python is
if-elif-else
An expression that evaluates to either true or false is called
Boolean
When a program is being run directly (not imported), the value of __name__ is
__main__
The literals for type bool are
True, False