Check sibling questions

What are default arguments?

 

Answer:

Default arguments in python are those arguments that get assigned a default value if no explicit values are passed to these arguments in the function call.

Example:

def square_num (int a= 2 ):

    s=a*a

    return s

If a value is not passed when the above function is invoked, then, by default, ‘a’ gets assigned the value 2.

Are ads bothering you?

CA Maninder Singh's photo - Expert in Practical Accounts, Taxation and Efiling

Made by

CA Maninder Singh

CA Maninder Singh is a Chartered Accountant for the past 12 years. He also provides Accounts Tax GST Training in Delhi, Kerala and online.