首先导入math模块,然后调用pow()函数,即可实现幂运算,示例如下:
import math math.pow(2,3)
结果如下:
8
众多python培训视频,尽在python学习网,欢迎在线学习!