Part 1: Python Decision Making

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

what is an "if" statement?

it is a statement that contains a Boolean (T/F) expression followed by one or more statements

what is a "nested if" statement?

one if or if ... else statement inside another if or if ... else statement

what are "nested loops"?

one or more loops inside another one

what does a "pass statement" do?

the pass statement is used when a statement is required for syntax but you don't want any command or code to execute

describe the function of a "for loop"

a "for loop" executes a sequence of statements multiple times and abbreviates the code that manages the loop variable

What is a Control Structure?

a block of programming that analyzes variables and chooses a direction in which to go based on given parameters

what does a "break statement" do?

a break statement terminates the loop statement and transfers execution to the statement immediately following the loop

what is an "else" statement?

a command that executes if the Boolean value from the "if" statement is FALSE

What is a Loop Statement?

a control structure that allows us to execute a statement or a group of statements multiple times

describe the function of a "while loop"

a while loop repeats a statement or a group of statements while a given condition is TRUE (it tests the condition before executing the loop body)

what is an "if ... else" statement?

an "if" statement that is followed by an optional "else" statement

what does a "continue statement" do?

causes the loop to skip the remainder of its body and immediately retest the condition prior to reiterating

What does the term Flow Control mean?

flow control tells us which direction the program takes (which way the program "flows")

What is the general form of a typical decision making structure?

Condition: if true > conditional code if false > do nothing

What do conditions do?

Conditions specify the actions taken to execute a program

What is decision making?

Decision making is the anticipation of conditions occuring while executing a program

In what order are statements executed

In general, statements are executed sequentially: the first statement is executed first, and so on.

What are Loop Control Statements?

Loop control statements are statements that change execution from its normal sequence.

Unless the value is zero or null, what does Python assume the value is in Boolean terms?

TRUE

What do decision structures evaluate?

Decision structures evaluate multiple expressions which produce TRUE or FALSE as the outcome


Ensembles d'études connexes

nclex/ end of chapter questions: Pain Assessment and Management chapter 30

View Set

ethics and the criminal justice system

View Set

Business Law Chapter 11 The Agreement: Acceptance

View Set

OB example questions (NCLEX style)

View Set

Durham - Chapter 12 Postpartum Physiological Assessments and Nursing Care

View Set

Spine and Thorax test review continue

View Set