Python 101 : Default and arbitrary arguments
The asterisk "*" when used before a parameter enable a function to receive a variable number of arguments.
We usually use it when we don't know before hand the number of arguments a function will get.
Example:
The default argument allows us to call a function without using any arguments. If we decide to use arguments, their value will override the default value:
Comments
Post a Comment