Chapter 3 Flashcards
Control Structure
Logical design that controls order in which set of statements execute.
Sequence Structure
Set of statements that execute in the order they appear.
Decision Structure/ Selection Structure
Specific action(s) perform only if a condition exists.
Single Alternative Decision Structure
Provides only one alternative path of execution.
Boolean Expression
Expression tested by if statement to determine if it is true or false.
Relational Operator
Determines whether a specific relationship exists between two values.
Dual Alternative Decision Structure
Two possible paths of execution.
How are strings compared?
By looking at the ASCII values for each individual character.
What would the following code display? if ‘z’ < ‘a’: print(‘z is less than a’) else: print(‘z is not less than a’)
z is not less than a
What would the following code display? s1 = ‘New York’ s2 = ‘Boston’ if s1 > s2: print(s2) print(s1) else: print(s1) print(s2)
New York is greater than Boston
Logical Operators
Operators that can be used to create complex Boolean expressions.
Short Circuit Evaluation
Deciding the value of a compound Boolean expression after evaluating only one sub expression.
Boolean Variable
References on of two values, True or False.