Module 5 Flashcards
function
sets result to 6.83
a named sequence of instructions:
example:
round function-
price = round (6.8275, 2)
arguments
the values for which we want the function to compute a result
it is first computed before it is passed to the function.
return value
the result that the function computes
when defining a function
you provide a name for the function and a variable for each argument.
parameter variable
a variable of a method or function that is initialized with a value when it is called.
header
the first line of the function’s definition:
body
the body contains the statements that are executed when the function is called.
return statement is used for
giving the function’s result to the caller.
def function
used to define and write the function identifier
Parameter variables
specifying expressions to be arguments for a method or function when it is called AKA formal parameters
stepwise refinement
solving a problem by breaking it into smaller problems and then further decomposing those smaller problems
argument
a value supplied in a function or method call, or one of the values combined by an operator AKA actual parameters