default arguments python

Publicado el: 14 abril 2020
en el canal de: Tarun Sir
162
10

In this video you will learn about default argument or default parameters in function in python.

What is Default Parameter Value/ Default Arguments
Python allows us to specify default value for parameters. The default value of parameter is used when we do not pass argument for that parameter. If a function defines default value for some of its parameters then those parameters must appear on right most side in definition.
In the following example we are defining a function greeting() which have parameter name having default value "Bhaarat". If we call the function greeting() without passing argument then it uses default value Bhaarat for parameter name.
def greeting(name="Bhaarat"):
print("Hello Dear",name)
greeting()#Prints Hello Dear Bhaarat
greeting("Khushal")#Prints Hello Dear Khushal


The parameters which have default value , are also called as optional argument.

#python_by_tarun_sir #tarun_sir #python #tarun_sir_python #python_video_44 #default_argument_in_python #python_tutorial #create_default_argument_function_in_python


En esta página del sitio puede ver el video en línea default arguments python de Duración hora minuto segunda en buena calidad , que subió el usuario Tarun Sir 14 abril 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 162 veces y le gustó 10 a los espectadores. Disfruta viendo!