Zybooks Chapter 3

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

1/21

flashcard set

Earn XP

Last updated 2:34 PM on 10/11/22
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

22 Terms

1
New cards
Branch
A sequence of statements only executed under a certain.
2
New cards
if branch
A branch taken only IF an expression is true
3
New cards
if-else
Has two branches. The first branch is executed IF an expression is true, ELSE the other branch is executed.
4
New cards
If-elseif-else branches
Each branch's expression is checked in sequence; as soon as one branches expression is found to be true, that branch is taken. If no expression is found true, execution will reach the else branch, which then executes.
5
New cards
If statement
Executes a group of statements if an expression is true. The statements in a branch must be indented some number of spaces, typically four spaces.
6
New cards
Equality operator (==)
Evaluates to true if the left and right sides are equal.
7
New cards
Inequality operators (!=)
Evaluates to true if the left and right sides are not equal or different
8
New cards
Boolean
An expression involving an equality or inequality operator. It has just two values: True or False. True and False are keywords in Python and must be capitalized.
9
New cards
If-else statement
Executes one group of statements when an expression is true, and another group of statements when the expression is false.
10
New cards
Multi-branch if-else statements
Each branch's expression is checked in sequence. As soon as one branch's expression is found to be true, that branch's statement executes (and no subsequent branch is considered). If no expression is true, the else branch executes.
11
New cards
Relational operator
Checks how one operand's value relates to another, like being greater than.
12
New cards
Operator Chaining
(a < b < c) Chaining performs comparisons left to right, evaluating a < b first. If the result is true, then b < c is evaluated next. If the result of the first comparison a < b is False, then there is no need to continue evaluating the rest of the expression.
13
New cards
Logical operator
Treats operands as being True and False, and evaluates to True or False. Include AND, OR, and NOT
14
New cards
Logical AND
True when both of its operands are True
15
New cards
Logical OR
True when at least one of its two operands are True
16
New cards
Logical NOT
True when its one operand is False, and vice-versa.
17
New cards
Boolean AND
True when both operands are True
18
New cards
Boolean OR
True when at least one operand is True.
19
New cards
Boolean NOT(opposite)
True when the single operand is False (and False when operand is True)
20
New cards
Nested if-else statements
A branch's statements can include any valid statements, including another if-else statement.
21
New cards
Precedence rules
The order in which operators are evaluated in an expression.
22
New cards
Code Block
A series of statements that are grouped together. Identified by its indentation level, i.e, the number of blank columns from the left edge.