As a beginner in Python programming, I am sure you have heard a lot about *args and **kwargs. So what exactly are they? A thread🧵
1
1
1
Replies
Yes, *args and **kwargs allow for passing an unlimited number of arguments to a function in Python. The special syntax *args in function definitions in Python allows us pass a variable number of non-keyworded arguments to a function. Find an example below.
1
0
0
Similarly, the keyworded **kwargs arguments allows the user to pass a variable number of keyworded arguments to a function. For instance, you can pass a dictionary of arguments to a function and unpack them using **kwargs. Check the example below:
1
0
0