Deck 3: Simple functions

Full screen (f)
exit full mode
Question
The function header marks the beginning of the function definition.
Use Space or
up arrow
down arrow
to flip the card.
Question
A function definition specifies what a function does and causes the function to execute.
Question
A(n) _____ is any piece of data that is passed into a function when the function is called.

A) global
B) argument
C) scope
D) parameter
Question
A(n) _____ variable is created inside a function.

A) global
B) constant
C) defined
D) local
Question
The hierarchy chart shows all the steps that are taken inside a function.
Question
When a function is called by its name, then it is _____.

A) executed
B) located
C) defined
D) exported
Question
A(n) _____ is a variable that receives an argument that is passed into a function.

A) global
B) argument
C) scope
D) parameter
Question
A set of statements that belong together as a group and contribute to the function definition is known as a(n) _____.

A) header
B) block
C) return
D) parameter
Question
What is a group of statements that exists within a program for the purpose of performing a specific task?

A) function
B) subtask
C) procedure
D) subprogram
Question
The _____ argument specifies which parameter the argument should be passed into.

A) keyword
B) local
C) global
D) string
Question
A(n) _____ chart is also known as a structured chart.

A) flow
B) data
C) hierarchy
D) organizational
Question
The first line in the function definition is known as the function _____.

A) header
B) block
C) return
D) parameter
Question
A(n) _____ variable is accessible to all the functions in a program file.

A) keyword
B) local
C) global
D) string
Question
It is recommended that programmers should avoid using _____ variables in a program when possible.

A) local
B) global
C) string global
D) keyword
Question
A local variable can be accessed from anywhere in the program.
Question
A variable's _____ is the part of a program in which the variable may be accessed.

A) global
B) argument
C) scope
D) local
Question
A(n) _____ constant is a global name that references a value that cannot be changed.

A) keyword
B) local
C) global
D) string
Question
The _____ design technique can be used to break down an algorithm into functions.

A) subtask
B) block
C) top-down
D) simplification
Question
The _____ of a local variable is the function in which the variable is created.

A) global
B) defined
C) local
D) scope
Question
Python function names follow the same rules for naming variables.
Question
One of the reasons not to use global variables is that it makes a program hard to debug.
Question
Python allows for passing multiple arguments to a function.
Question
Arguments are passed by _______________ to the corresponding parameter variables in the function.
Question
The approach called _______________ is taking a large task and dividing it into several smaller tasks that are easily performed.
Question
The main function contains a program's _______________ logic, which is the overall logic of the program.
Question
To assign a value to a global variable in a function, the global variable must first be declared in the function.
Question
In a flowchart, a function call is depicted by a(n) _______________ that has vertical bars.
Question
The code for a function is known as a function _______________.
Question
The top-down design breaks down the overall task of the program into a series of _______________.
Question
Different functions can have local variables with the same names.
Question
The function header begins with the keyword _______________ followed by the name of the function.
Question
A variable is visible only to statements in the variable's _______________.
Question
The value assigned to a global constant can be changed in the mainline logic.
Question
A(n) _______________ chart is a visual representation of the relationships between functions.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/34
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 3: Simple functions
1
The function header marks the beginning of the function definition.
True
2
A function definition specifies what a function does and causes the function to execute.
False
3
A(n) _____ is any piece of data that is passed into a function when the function is called.

A) global
B) argument
C) scope
D) parameter
B
4
A(n) _____ variable is created inside a function.

A) global
B) constant
C) defined
D) local
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
5
The hierarchy chart shows all the steps that are taken inside a function.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
6
When a function is called by its name, then it is _____.

A) executed
B) located
C) defined
D) exported
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
7
A(n) _____ is a variable that receives an argument that is passed into a function.

A) global
B) argument
C) scope
D) parameter
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
8
A set of statements that belong together as a group and contribute to the function definition is known as a(n) _____.

A) header
B) block
C) return
D) parameter
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
9
What is a group of statements that exists within a program for the purpose of performing a specific task?

A) function
B) subtask
C) procedure
D) subprogram
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
10
The _____ argument specifies which parameter the argument should be passed into.

A) keyword
B) local
C) global
D) string
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
11
A(n) _____ chart is also known as a structured chart.

A) flow
B) data
C) hierarchy
D) organizational
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
12
The first line in the function definition is known as the function _____.

A) header
B) block
C) return
D) parameter
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
13
A(n) _____ variable is accessible to all the functions in a program file.

A) keyword
B) local
C) global
D) string
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
14
It is recommended that programmers should avoid using _____ variables in a program when possible.

A) local
B) global
C) string global
D) keyword
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
15
A local variable can be accessed from anywhere in the program.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
16
A variable's _____ is the part of a program in which the variable may be accessed.

A) global
B) argument
C) scope
D) local
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
17
A(n) _____ constant is a global name that references a value that cannot be changed.

A) keyword
B) local
C) global
D) string
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
18
The _____ design technique can be used to break down an algorithm into functions.

A) subtask
B) block
C) top-down
D) simplification
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
19
The _____ of a local variable is the function in which the variable is created.

A) global
B) defined
C) local
D) scope
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
20
Python function names follow the same rules for naming variables.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
21
One of the reasons not to use global variables is that it makes a program hard to debug.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
22
Python allows for passing multiple arguments to a function.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
23
Arguments are passed by _______________ to the corresponding parameter variables in the function.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
24
The approach called _______________ is taking a large task and dividing it into several smaller tasks that are easily performed.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
25
The main function contains a program's _______________ logic, which is the overall logic of the program.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
26
To assign a value to a global variable in a function, the global variable must first be declared in the function.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
27
In a flowchart, a function call is depicted by a(n) _______________ that has vertical bars.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
28
The code for a function is known as a function _______________.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
29
The top-down design breaks down the overall task of the program into a series of _______________.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
30
Different functions can have local variables with the same names.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
31
The function header begins with the keyword _______________ followed by the name of the function.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
32
A variable is visible only to statements in the variable's _______________.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
33
The value assigned to a global constant can be changed in the mainline logic.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
34
A(n) _______________ chart is a visual representation of the relationships between functions.
Unlock Deck
Unlock for access to all 34 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 34 flashcards in this deck.