Chapter 5 Key Terms Flashcards
Function
A block of code that performs a certain task or set of tasks.
Divide and Conquer
Breaking down a problem into smaller problems that can be solved. Then combining the solutions to solve the initial problem. Functions can be executed in order.
Benefits of Using Functions
Benefits include a much simpler code, reusable code, effective testing and debugging, faster development, and easier teamwork when writing codes.
Void Functions
Executes the statements it contains, then terminates.
Value-Returning Functions
Executes the statements it contains, and returns a value back to the statement that called it.
Function Names
Names cannot contain keywords or spaces. The first character has to either be a letter or underscore. Other characters must be a letter, number or underscore. The uppercase and lowercase characters are distinct.
Function Definition
Determines what that function does.
Function Header
The first line of the function
Block
A set of statements that belong together as a group.
Function Call
A way to execute a specific block of code defined within a function. The interpreter jumps to the function and executes the statement.
Indentation and Functions
Each block needs to be indented and the lines must start with the same number of spaces.
pass
Used as a placeholder statement that does nothing when executed.
Local Variables
Variable that is given a value inside a function.
Variable Scope
The part of a program where the variable may be accessed.
Argument
The data that is sent into a function.