Python 代码实现复数乘法和数组操作
a = [1, 1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1]
a_repeated = a + a + a + (-a) + (-a) + a + (-a) + (-a) + a + a + a + (-a) + a + (-a) + a + a result = [] for i in range(len(a_repeated)): result.append((1 + 1j) * a_repeated[i] * (-1) ** i)
print(result)
原文地址: https://www.cveoy.top/t/topic/ncY2 著作权归作者所有。请勿转载和采集!