Default arguments take the default value during the function call if we do not pass them. We can assign a default value to an argument in function definition using the = assignment operator.
Solution:
# function with default argument
def show_employee(name, salary=9000):
print("Name:", name, "salary:", salary)
show_employee("Ben", 12000)
show_employee("Jessa")
Hint:
Default arguments take the default value during the function call if we do not pass them. We can assign a default value to an argument in function definition using the
=
assignment operator.Solution:
Explanation:
need an explanation for this answer? contact us directly to get an explanation for this answer