Lecture 4: Boolean Expressions and Conditionals

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

1/14

flashcard set

Earn XP

Description and Tags

Flashcards testing core vocabulary and concepts related to procedural knowledge, Boolean logic, relational and logical operators, order of operations, and conditional statements in Python.

Last updated 4:47 AM on 9/16/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

15 Terms

1
New cards

Procedural Knowledge

Knowledge of how to do things through described processes, instructions, recipes, or computer algorithms.

2
New cards

Boolean Expression

An expression that evaluates to a Boolean value, which can only be either True or False.

3
New cards

Relational Operators

Operators used to compare two values, such as equality (====), inequality (!=!=), less than (<<), greater than (>>), less than or equal to (<=<=), and greater than or equal to (>=>=).

4
New cards

Equality Operator (====)

A relational operator that tests whether two values are equal, written with two equal signs to distinguish it from the single-equal variable assignment operator.

5
New cards

Boolean Operators

Logical operators including and\text{and}, or\text{or}, and not\text{not} that operate on Boolean values to form complex logical decisions.

6
New cards

Logical operator: and\text{and}

A Boolean operator that evaluates to True if and only if both input conditions are True; otherwise, it evaluates to False.

7
New cards

Logical operator: or\text{or}

A Boolean operator that evaluates to True if at least one input condition is True; it evaluates to False only if both conditions are False.

8
New cards

Logical operator: not\text{not}

A unary Boolean operator that reverses a Boolean value, turning True to False and False to True.

9
New cards

Conditional Evaluation Order

The order of precedence across expression types: Mathematical operators are evaluated first, followed by Relational operators, followed by Boolean operators (with not\text{not} evaluated before and\text{and}, and and\text{and} evaluated before or\text{or}).

10
New cards

if Statement

A conditional control statement that executes a designated block of code if and only if its associated Boolean condition evaluates to True.

11
New cards

Indentation (Python)

A required syntactic structure in Python (typically 4 spaces or 1 tab) used to group statements inside a conditional or control block.

12
New cards

if-else Statement

A conditional structure with two execution paths: one executed when the Boolean condition is True, and another executed when it is False.

13
New cards

if-elif-else Statement

A multi-branch conditional structure that sequentially checks multiple Boolean expressions and executes ONLY the code block associated with the FIRST condition that evaluates to True.

14
New cards

Nested Branches

The technique of placing a conditional statement (if, if-else, or if-elif-else) inside another conditional block to structure complex or ordered decision logic.

15
New cards

in Operator

A Boolean operator that tests whether an exact value or sub-sequence exists within a given sequence, such as a string.