Conditionals and Recursion Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

modulus operator

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
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
3
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
4
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
5
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
6
Q

condition

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
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 heaader.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
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
9
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
10
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
11
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
12
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
13
Q

infinite recursion

A

A recursion that doesn’t 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