Chapter 6 Flashcards

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

TF

Programmers rarely define their own functions.

A

False

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

TF

A function may only be called at one place in a program.

A

False

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

TF

Information can be passed into a function through parameters.

A

True

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

TF

Every Python function returns some value.

A

True

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

TF

In Python, some parameters are passed by reference.

A

False

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

TF

In Python, a function can return only one value.

A

False

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

TF

Python functions can never modify a parameter.

A

False

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

TF

One reason to use functions is to reduce code duplication.

A

True

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

TF

Variables defined in a function are local to that function.

A

True

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

TF

It’s a bad idea to define new function if it makes a program longer.

A

False

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

The part of the program that uses a function is called the

A

Caller

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

A Python function definition begins with

A

def

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

A function can send output back to the program with a(n)

A

Return

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

Formal and actual parameters are matched up by

A

Position

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

Which of the following is not a step in the function-calling process

A

Control returns to the point just before the function was called

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

In Python, actual parameters are passed to functions

A

By value

17
Q

Which of the following is not a reason to use functions

A

to demonstrate intellectual superiority

18
Q

If a function returns a value, it should generally be called from

A

an expression

19
Q

A function with no return statement returns

A

None

20
Q

A function can modify the value of an actual parameter only if it’s

A

Mutable