4.1 A decision structure allows a program to perform actions only under certain conditions – also known as selection structures. In its simplest form a specific action is performed only if a certain condition exists. If the condition does not exist the action is not performed. Single alternative decision structure – because it provides only one alternative path of execution. If the condition In the diamond symbol is true we take the alternative path. Otherwise we exit the structure. Writing a Decision Structure in Pseudocode If condition Then Statement Statement Statement End If Boolean Expressions and Relational Operators Checkpoint Dual alternative decision structure – has two possible paths of execution – one path is taken if a condition is true and other path is taken if the condition is false. Checkpoint 4.3 Comparing Strings Checkpoint 4.4 Nested Decision Structures The If-Then-Else If Statement Insert as many Else If clauses as necessary Checkpoint Does the If statement causes one or more statements to execute only when a Boolean expression is true?In Python, the if statement is used to create a decision structure, which allows a program to have more than one path of execution. The if statement causes one or more statements to execute only when a Boolean expression is true.
Which structure determines the order in which a set of statements executes?A control structure is a logical design that controls the order in which a set of statements execute.
Which of the following is the correct If clause to use to determine whether choice is other than 10?Review of Python Chapter 2. Which logical operators perform shortWhich logical operators perform short-circuit evaluation? Short-circuit evaluation is performed with the not operator.
|