Chapter 3 Terms Flashcards
if statement
The if statement is used for a conditional execution.
Control Structure
Statement or set of statements that control the execution of a program.
Decision or Selection Structure
Programming constructs that allow decisions to be made based on the conditions given.
Single Alternative Decision Structure
Only allows a block of code to execute if and only if a condition is true.
Boolean Expression
An expression that evaluates true or false.
Relational Operators
Symbols used to compare values.
<
Checks if the left operand is less than the right operand.
>
Checks if the left operand is greater than the right operand.
<=
Checks if the operand is less than or equal to the right.
> =
Checks if the operand is greater than or equal to the right.
==
Checks if both values are equal.
!=
Checks if both values are not equal.
if-else statement
A decision making structure in which if indicates a true statement and else indicates a false statement.
Dual Alternative Decision Structure
Gives two different pathways to execute a program based on multiple conditions.
Indentation
It is used to define relationships and statements. Part of the code’s syntax.
String Comparison
The comparisons of two strings to figure out their order.
if-elif-else Statement
Allows for multiple structured conditions. It is used when there are more than two possible outcomes.
Logical Operators
Operators that are used to combine the boolean values.
and
This operator is true if both operands are true. If not, then it is false.
or
This operator is true if one of the operands is true.
not
This operator is the opposite of its operand. If true, then false and if false, then true.
Short-Circuit
An evaluation in which the first operand can be determined, therefore, the second operand will not be evaluated.
Boolean Variables
Variables that can either be true or false.