What does *args collect in a function definition?

Python Developer Medium

Python Developer — Medium

What does *args collect in a function definition?

Key points

  • *args gathers extra positional arguments into a tuple
  • Helps handle variable numbers of arguments efficiently
  • Different from **kwargs, which collects keyword arguments

Ready to go further?

Related questions