2.2.3 *args & **kwargs
Introduction
args and kwargs are used to pass arguments to a function. args is used to pass a variable number of positional arguments to a function, and kwargs is used to pass a variable number of keyword arguments to a function.
args
args is used to pass a variable number of positional arguments to a function. It is a tuple.
kwargs
kwargs is used to pass a variable number of keyword arguments to a function. It is a dictionary.
Example 1
Sketch and analyze .
Solution
-intercept: when .
-intercepts: solve , or :
Vertex:
So the vertex is a maximum point. The function is increasing on and decreasing on .
Finding Maximum and Minimum Values by Completing the Square
Completing the square rewrites in vertex form. It is a dictionary.
Example 3
Find the maximum or minimum value of .
Solution
Here , , :
Since , the minimum value of at is .