Chapter 5 Conditionals and Recursion Flashcards

1
Q

Floor Divison

A

An operator, denoted //, that divides two numbers and round down (toward negative infinity) to an integer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Modulus Operator

A

An operator, denoted with a percent sign (%), that works on integers and returns the remainder when one number is divided by another.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Boolean Expression

A

An expression whose value is either True or False.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Relational Operator

A

One of the operators that compares its operands:==, !=, >, <, >= and <=.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Logical Operator

A

One of the operators that combines boolean expressions: and, or and not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Conditional Statement

A

A statement that controls the flow of execution depending on some condition.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Condition

A

The boolean expression in a conditional statement that determines which branch runs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Compound Statement

A

A statement that consists of a header and a body. The header ends with a colon (:). The body is indented relative to the header.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Branch

A

One of the alternative sequences of statements in a conditional statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Chained Conditional

A

A conditional statement with a series of alternative branches.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Nested Conditional

A

A conditional statement that appears in one of the branches of another conditional statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Return Statement

A

A statement that causes a function to end immediately and return to the caller.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Recursion

A

The process of calling the function that is currently executing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Base case

A

A conditional branch in a recursive function that does not make a recursive call.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Infinite Recursion

A

A recursion that does not have a base case, or never reaches it. Eventually, an infinite recursion causes a runtime error.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly