1/15
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Block
A group of consecutive indented statements (same indentation.) that follow boolean (ex: after if statement)
Body
The block of statements in a compound statement that follows the header.
Boolean Expression
An expression that evaluates to either True or False. EX: print(3<5) → True
Boolean Function
A function that returns a boolean value. The only possible values of the bool type are False and True.
Boolean Value
There are exactly two boolean values:True and False. Boolean values result when a boolean expression is evaluated by the Python interpreter. They have type bool.
Branch
One of the possible paths of the flow of execution determined by conditional execution.
Chained Conditional
A conditional branch with more than two possible flows of execution. In Python chained conditionals are written with if ... elif ... else statements.
Comparison Operator
One of the operators that compares two values:==, !=, >,
Condition
The boolean expression after the if statement→ in a conditional statement that determines which branch is executed.
Conditional Statement / Selection statement
A statement that controls the flow of execution depending on some condition. In Python the keywords if, elif, and else are used
Logical Operator
One of the operators that combines boolean expressions: and, or, and not.
Modulus Operator
An operator, denoted with a percent sign (%), that works on integers and yields the remainder when one number is divided by another.
Nesting
One program structure within another, such as a conditional statement inside a branch of another conditional statement.
unary selection
Form of the if statement where the else clause is omitted entirely EX:
number = int(input("Enter a non-negative number: "))
if number < 0:
print("Sorry, negative numbers are not allowed.")
print("Your number was", number)the last print is always executed → could use else: pass if uncomfortable w/ no else statement
short-circuiting
When the evaluation of a logical expression stops bc the overall value is already known → EX: print(x >= 2 and y != 0 and (x/y) > 2) → if x >= 2 is false, neither y != 0 or (x/y)>2 is evaluated
guard
A comparison put in place to cause short circuit behavior and avoid a runtime error.guard