Python allows function arguments to have default values; if the function is called without the argument, the argument gets its default value
Python has a different way of representing syntax and default values for function arguments. Default values indicate that the function argument will take that value if no argument value is passed during function call. The default value is assigned by using assignment (=) operator. Below is a typical syntax for default argument. Here, foo parameter has a default value Hi!
def defaultArg(name, foo='Come here!'): print name,foo defaultArg('Joe')
Joe Come here!
We see that in the above code there is one required argument and one default one in the declaration. In the output we see that both the arguments are printed even though only one argument was passed in the function call. The default argument is passed automatically and appears in the output of the function call.