AP Computer Science Principles: Boolean Expressions

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

1/12

flashcard set

Earn XP

Description and Tags

A set of vocabulary flashcards defining key terms and concepts related to Python Boolean expressions, operators, precedence rules, and pseudocode syntax.

13 Terms

1
New cards

Boolean Expression

An expression that evaluates to exactly one of two Boolean values: True or False.

2
New cards

Selection

A programming structure, such as an if statement, that runs code only when its condition evaluates to True.

3
New cards

Relational Operators

Operators used to compare two values in Python, including ====, !=!=; >>; <<; >=>=; and <=<=; which evaluate to True or False.

4
New cards

Assignment Operator (==)

An operator that stores a value in a variable (for example, score=85score = 85 means score receives 85).

5
New cards

Equality Operator (====)

A relational operator in Python that checks whether two values are equal, returning True or False.

6
New cards

Case Sensitivity in String Comparisons

The rule in Python where string comparisons evaluate both characters and capitalization (for example, "AP CSP"=="ap csp"\text{"AP CSP"} == \text{"ap csp"} evaluates to False).

7
New cards

Logical Operators

Operators in Python (and, or, not) used to combine or reverse Boolean conditions.

8
New cards

and Operator

A logical operator that requires both conditions to be True for the result to be True.

9
New cards

or Operator

A logical operator that returns True if at least one condition is True, and returns False only when both conditions are False.

10
New cards

not Operator

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

11
New cards

Operator Precedence

The required order for evaluating expressions in Python: Parentheses ()( ), followed by comparisons, NOTNOT, ANDAND, and finally OROR.

12
New cards

De Morgan's Laws

Rules of logical equivalence stating that not (A and B)not\,(A \text{ and } B) is equivalent to (not A) or (not B)(not\,A) \text{ or } (not\,B), and not (A or B)not\,(A \text{ or } B) is equivalent to (not A) and (not B)(not\,A) \text{ and } (not\,B).

13
New cards

AP CSP Pseudocode Assignment Symbol (←\leftarrow)

The arrow symbol (←\leftarrow) used in AP CSP pseudocode to assign a value to a variable, reserving == exclusively for equality comparisons.