2.4.5 Declare and call functions and procedures Flashcards
Define:
Function
Code written to perform a specific task and can be used more than once
Define:
Built-in Functions
Functions included in the programming language
Define:
User-defined functions (UDFs)
Functions that can be created by software developers
Define:
Anonymous Function
Also known as lambda functions, functions not declared with the standard keyword (‘def’ in Python)
Define:
Method
A function that is part of a class and is accessed using an instance or object of a class
Define:
Arguments
Value that is sent to a function
Define:
Parameter
Variable that is listed inside the parentheses of a function
State:
2 requirements of a procedure
- Name
- Programming code to perform required task (code block)
State:
Difference between Procedure & Function
Function: Returns a value and control, compiled before and re-compiled if needed - with different parameter values
Procedure: Returns the control but no value, only compiled once - no values will change, a paramater value once accepted once cannot change