Extended Argument Syntax
What is the syntax for passing arguments to a function in Python?
What is a default argument in Python?
What happens if the number of arguments passed to a function does not match with the number of arguments defined in the function signature?
How can you pass an arbitrary number of arguments to a function in Python?
Which of the following is an example of a default argument in Python?
What is the purpose of arbitrary arguments in Python?
What is the output of the following code snippet?
def my_fun(a, b, *args):
print(a, b, args)
my_fun(1,2,3,4,5,6)
Which of the following statements is true about required arguments in Python functions?
What is the output of the following code snippet?
def my_fun(a, b, **kwargs):
print(a, b, kwargs)
my_fun(1,2, x=10, y=20)
What is the purpose of the double asterisk (**) before an argument in a Python function definition?