You have written a function that accepts any number of positional and keyword arguments and prints them. However, the function signature does not specify any parameter names. How was this achieved?

  • Using Default Arguments
  • Using Variable-Length Argument Lists with *args and **kwargs
  • Using Variable-Length Argument Lists with var_args and kw_args
  • Using the args and kwargs Keywords
This is achieved by using variable-length argument lists with *args and **kwargs in the function signature. *args allows you to pass any number of positional arguments, and **kwargs allows you to pass keyword arguments without specifying their names.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *