How do you declare a function
def, followed by function name , followed by list of arguments to be passed to the function, ends with colon
docstring
documentation string that describes in words what the problem does
function
a block of code that can be reused multiple times with different input data
How does writing more code increase the likelihood of errors?
More code means some sections are used less frequently, making errors harder to detect and more likely
What is the order in which arguments should be passed into a function
Order in which function arguments are listed
Why is it useful to have a default argument values that can override functions
Saves the programmer effort, less code to write
Scope
the variables declared inside the function are not visible outside the function
do not have to worry about variables affecting other parts of program
Recursion
Function makes called to itself
Named arguments
Used when a function has numerous arguments
Case order does not matter
Enhances program readability + reduces errors