Learn how to pass variable number of arguments to functions in Python

If you are a beginning Python programmer, you might come across function declarations with parameters that look like this:

def do_something(num1, num2, *args, **kwargs):

The * and the * operators above allow you to pass in variable number of arguments to the function. However, this feature often creates a lot of confusion for Python programmers. This article shall attempt to make it clear on the usefulness of the  and ** operators, and how you can use them in your daily programming task.

#optional-arguments #args-and-kwargs #keyworded-arguments #parameter #python

Understanding *args and **kwargs in Python
1.10 GEEK