Chapter 4 Flashcards Preview

Python > Chapter 4 > Flashcards

Flashcards in Chapter 4 Deck (15)
Loading flashcards...
1
Q

block

A

A group of consecutive statements with the same indentation.

2
Q

body

A

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

3
Q

boolean expression

A

An expression that is either true or false.

4
Q

boolean value

A

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

5
Q

branch

A

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

6
Q

chained conditional

A

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

7
Q

comparison operator

A

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

8
Q

condition

A

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

9
Q

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.

10
Q

logical operator

A

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

11
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.

12
Q

nesting

A

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

13
Q

prompt

A

A visual cue that tells the user to input data.

14
Q

type conversion

A

An explicit statement that takes a value of one type and computes a corresponding value of another type.

15
Q

wrapping code in a function

A

The process of adding a function header and parameters to a sequence of program statements is often refered to as “wrapping the code in a function”. This process is very useful whenever the program statements in question are going to be used multiple times.