在python中计算乘方非常方便 使用两个**运算符就可以。

示例代码如下

>>> 5 ** 2  # 5 squared
25
>>> 2 ** 7  # 2 to the power of 7
128