Chapter 3: Decision Structures and Boolean Logic

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/27

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards covering Python decision structures, relational operators, string comparison, nested conditions, logical operators, Boolean variables, walrus operators, and Turtle Graphics state functions.

Last updated 4:51 PM on 9/29/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

28 Terms

1
New cards

Control Structure

A logical design that controls the order in which a set of statements execute.

2
New cards

Sequence Structure

A set of statements that execute in the exact order in which they appear.

3
New cards

Decision Structure

A control structure in which specific action(s) are performed only if a condition exists; also known as a selection structure.

4
New cards

Single Alternative Decision Structure

A decision structure that provides only one alternative path of execution; if the condition is not true, the structure is exited.

<p>A decision structure that provides only one alternative path of execution; if the condition is not true, the structure is exited.</p>
5
New cards

Boolean Expression

An expression tested by an if statement to determine whether it evaluates to True or False.

6
New cards

Relational Operator

An operator that determines whether a specific relationship exists between two values, such as greater than (>>) or equal to (====).

7
New cards

Dual Alternative Decision Structure

A decision structure with two possible paths of execution: one path is executed if the condition is true, and the other if it is false.

<p>A decision structure with two possible paths of execution: one path is executed if the condition is true, and the other if it is false.</p>
8
New cards

String Comparison in Python

The comparison of strings character by character based on their ASCII values using relational operators.

<p>The comparison of strings character by character based on their ASCII values using relational operators.</p>
9
New cards

Nested Decision Structure

A decision structure contained inside another decision structure, used to test multiple conditions sequentially.

<p>A decision structure contained inside another decision structure, used to test multiple conditions sequentially.</p>
10
New cards

if-elif-else Statement

A special Python decision structure that simplifies nested decision structures by supporting multiple elif clauses.

<p>A special Python decision structure that simplifies nested decision structures by supporting multiple elif clauses.</p>
11
New cards

Logical Operators

Operators (and, or, not) used to connect Boolean expressions to create compound Boolean expressions.

12
New cards

and Operator

A binary logical operator that creates a compound Boolean expression that is true only when both subexpressions are true.

13
New cards

or Operator

A binary logical operator that creates a compound Boolean expression that is true when either of the subexpressions is true.

14
New cards

not Operator

A unary logical operator that reverses the truth value of its Boolean operand.

15
New cards

Short-Circuit Evaluation

The process of determining the value of a compound Boolean expression after evaluating only the first subexpression.

16
New cards

Boolean Variable

A variable that references one of two values, True or False, represented in Python by the bool data type.

17
New cards

Flag

A Boolean variable that signals whether a specific condition exists within a program.

18
New cards

Walrus Operator

An enhanced assignment operator (:=:=) in Python used to create assignment expressions.

19
New cards

Assignment Expression

An expression created with the walrus operator (:=:=) that assigns a value to a variable and returns that value.

20
New cards

turtle.xcor() and turtle.ycor()

Turtle Graphics functions that return the turtle's current X and Y coordinates.

21
New cards

turtle.heading()

A Turtle Graphics function that returns the turtle's heading, by default in degrees.

22
New cards

turtle.isdown()

A Turtle Graphics function that returns True if the pen is down, or False otherwise.

23
New cards

turtle.isvisible()

A Turtle Graphics function that returns True if the turtle is visible, or False otherwise.

24
New cards

turtle.pencolor()

A Turtle Graphics function that returns the pen's current color as a string when called without an argument.

25
New cards

turtle.fillcolor()

A Turtle Graphics function that returns the current fill color as a string when called without an argument.

26
New cards

turtle.bgcolor()

A Turtle Graphics function that returns the current background color as a string when called without an argument.

27
New cards

turtle.pensize()

A Turtle Graphics function that returns the pen's current size as a string when called without an argument.

28
New cards

turtle.speed()

A Turtle Graphics function that returns the current animation speed when called without an argument.