标签: python arrays
假设有一个元组test = (1,2),我想计算10**test,它应该等于(10,100)。但是Python给出了错误 unsupported operand type(s) for ** or pow(): 'int' and 'tuple'
test = (1,2)
10**test
(10,100)
unsupported operand type(s) for ** or pow(): 'int' and 'tuple'
我如何在python中执行此操作?
答案 0 :(得分:5)
Numpy数组提供此功能:
getsockname()
如果你想使用普通的旧元组,你必须自己编写循环:
{{1}}