什么是*操作呢?

时间:2018-03-21 01:59:39

标签: python

我正在尝试一个简单的python代码。

unsigned char mask = ~0U;
mask >>= 4;

我得到了这个输出,这是预期的:

import numpy as np

x, y = np.full(5, 5.0), np.full(5, 5.0)
print("{} + {} = {}".format(x, y, x + y))

但是当我这样做时:

[5. 5. 5. 5. 5.] + [5. 5. 5. 5. 5.] = [10. 10. 10. 10. 10.]

我得到了这个输出:

import numpy as np

x, y = np.full(5, 5.0), np.full(5, 5.0)
print("{} + {} = {}".format(*x, y, x + y))

* x在这种情况下做了什么?

0 个答案:

没有答案
相关问题