Chapter 7 - Definitions Flashcards

1
Q

Define block

A

A group of consecutive statements w/the same indentation

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

Define body

A

The block of statements in a compound statement that follows the header

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

Define boolean expression

A

An expression that is either true or false

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

Define boolean function

A

A fxn that returns a boolean value. The only possible values of the bool type are False and True

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

Define boolean value

A

There are exactly 2 boolean values: True and False. Boolean values result when a boolean expression is evaluated by the Python interpreter. They have type bool.

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

Define branch

A

One of the possible paths of flow of execution determined by conditional execution

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

Define chained conditional

A

A conditional branch with more than 2 possible flows of execution. In Python chained conditionals are written with if… elif… else statements

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

Define comparison operator

A

One of the operators that compares 2 values: ==, !=, >, =, and <=

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

Define 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
10
Q

Define conditional statement

A

A statement that controls the flow of execution depending on some condition. In Python the keywords if, elif, and else are used for conditional statements

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

Define 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
12
Q

Define 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
13
Q

Define nesting

A

One program structure within another, such as a conditional statement inside a branch of another conditional statement

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