args and kwargs

You can also set up functions to accept any number of arguments or keyword arguments by using a special syntax. To get infinite arguments, use *args and for infinite keyword arguments, use **kwargs. The "args" and “kwargs” words are not important. That’s just convention. You could have called them *bill and **ted and it would work the same way. The key here is in the number of asterisks.

*Note: in addition to the convention of *args and **kwargs, you will also see a andkw from time to time.

Let’s take a look at a quick example:

Get hands-on with 1200+ tech skills courses.