What does this stuff mean: *args, **kwargs? And why would we use it?

Technology CommunityCategory: PythonWhat does this stuff mean: *args, **kwargs? And why would we use it?
VietMX Staff asked 3 years ago
  • Use *args when we aren’t sure how many arguments are going to be passed to a function, or if we want to pass a stored list or tuple of arguments to a function.
  • **kwargs is used when we dont know how many keyword arguments will be passed to a function, or it can be used to pass the values of a dictionary as keyword arguments.