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

Popular posts from this blog

Istio 101 : How Istio ServiceEntry relates to Kubernetes Services and Endpoints

Kubernetes 101 : - Scaling a Stateful set -

Python 101 : Generators and Lists