Chapters 2, 3, 5 & 6 Flashcards

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

Creating a new variable and giving it a value is called what?

A

An Assignment Statement

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

The “” diagram helps you see what state a variable is in.

A

state diagram

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

An ““is a combination of values, variables, and operators.

A

**expression **

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

A “” is a unit of code that has an effect, like creating a variable or displaying a
value.

A

statement

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

A mode where you interact directly with the interpreter. Hint: It’s not script

A

interactive mode

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

When an expression contains more than one operator, the order of evaluation depends on the?

A

order of operations

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

The + operator performs string “”, which means it joins the strings by linking them end-to-end.

A

** concatenation**

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

This error is called “” because it doesn’t appear until after the program has started.

A

Runtime error

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

If there is a “ “ in your program, it will run without generating error
messages, but it will not do the right thing.

A

semantic error

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

To run a statement and do what it says.

A

execute

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

A named sequence of statements that performs a computation.

A

function

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

A “” is a file that contains a collection of related functions.

A

module

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

The “ “ contains the functions and variables defined in the module.

A

module object

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

The argument of a function can be any kind of “ “, including arithmetic operators:

A

expression

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

A “ “ specifies the name of a new function and the sequence of statements that run when the function is called.

A

function definition

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

The first line of the function definition is called the “ “; the rest is called the “ “.

A

header and body

17
Q

Defining a function creates a function “”, which has type function.

A

object

18
Q

To ensure that a function is defined before its first use, you have to know the order statements run in, which is called the “ “.

A

flow of execution

19
Q

Inside a function, the arguments are assigned to variables called “”.

A

parameters
“A pair a meters”

20
Q

When you create a variable inside a function, it is “”

A

local

21
Q

” “ show the value of each variable, but they
also show the function each variable belongs to.

A

stack diagrams

22
Q

In a stack diagram, a “” is a box with the name of a function beside it and the parameters and variables of the function inside it.

A

frame

23
Q

A function that returns results is called a “ “ and a function that performs and action but doesn’t return a value is called?

A

fruitful or void function
“print into the void”
“return to fruit”

24
Q

A statement that reads a module file and creates a module object.

A

import statement

25
Q

The syntax for calling a function in another module by specifying the module name followed by a dot (period) and the function name.

A

dot notation

26
Q

A list of the functions that are executing, printed when an exception occurs.

A

traceback

27
Q

The floor “ “, //, divides two numbers and rounds down to an integer.

A

division operator

28
Q

An expression that is either true or false.

A

Boolean expression

29
Q

The == operator is one of the “” operators.

A

relational

30
Q

and, or, and not in Python are called?

A

logical operators

31
Q

The boolean expression after if is called the “”.

A

condition

32
Q

In an if statement, a header followed by an indented body is referred to as?

A

compound statement

33
Q

An if statement with more than one possibility.

A

chained conditional
if x < y:
print(‘x’)
elif x > y:
print(‘y’)
else:
print(‘x and y’)

34
Q

A function that calls itself is?

A

recursive
“read cursive”

35
Q

In a stack diagram, the bottom of the stack is called?

A

base case. It does not make a recursive call, so there are no more frames.