Difference between python *args and **kwargs

We often see:

1. Function parameters such as def func(**args, **kwargs), but we rarely notice the deep meaning inside. We were asked about this knowledge point during the interview today;

(1) The difference between the two, **args is a tuple (tuple), **kwargs is a dict, the tuple does not have append, insert and other operations, but the dict has 2;

(2) **args is any nameless parameter, **kwargs is any keyword parameter;

2. Check the top ten cpu-consuming commands in a system: ps aux|head -10

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324522971&siteId=291194637