Chapter 5, Part 1 Flashcards
Function
Group of statements within a program that perform a specific task.
Modularized program
Program wherein each task within the program is in its own function
Void function
Executes the statements it contains and then terminates
Value-returning function
Executes the statement it contains and then returns a value back to the statement that called it. The input(), float() and int() functions are examples of vale-returning functions.
Function definition
Specifies what the function does
def function_name() :
statement
statement
Function header
The first line of the function. Includes def and function_name, followed by parentheses and colon
Block
Set of statements that belong together as a group
Main function
Function called when the program starts
Top-down design
Technique for breaking down algorithms into functions.
Hierarchy chart
Depicts relationships between functions.
Local variable
Variable that is assigned a value inside a function.
Scope
The part of a program in which the variable may be accessed.
Argument
Piece of data that is sent into a function
Parameter variable
Variable that is assigned the value of the argument when the function is called. Or, a parameter is a variable that receives an argument that is passed into a function.
Scope of parameter
The function in which the parameter is used.