首页 > 编程 > Python > 正文

Python中pow()和math.pow()函数用法示例

2019-11-25 15:11:16
字体:
来源:转载
供稿:网友

本文实例讲述了Python中pow()和math.pow()函数用法。分享给大家供大家参考,具体如下:

1. 内置函数pow()

>>> help(pow)Help on built-in function pow in module __builtin__:pow(...)  pow(x, y[, z]) -> number  With two arguments, equivalent to x**y. With three arguments,  equivalent to (x**y) % z, but may be more efficient (e.g. for longs).>>>>>> pow(3,2) # 3**29>>> pow(3,2,4)# (3**2)%41

2. math.pow()

>>> import math>>> help(math.pow)Help on built-in function pow in module math:pow(...)  pow(x, y)  Return x**y (x to the power of y).>>> math.pow(3,2)9.0>>>

PS:这里再为大家推荐几款计算工具供大家参考使用:

在线一元函数(方程)求解计算工具:
http://tools.VeVB.COm/jisuanqi/equ_jisuanqi

科学计算器在线使用_高级计算器在线计算:
http://tools.VeVB.COm/jisuanqi/jsqkexue

在线计算器_标准计算器:
http://tools.VeVB.COm/jisuanqi/jsq

更多关于Python相关内容感兴趣的读者可查看本站专题:《Python数学运算技巧总结》、《Python数据结构与算法教程》、《Python函数使用技巧总结》、《Python字符串操作技巧汇总》、《Python入门与进阶经典教程》及《Python文件与目录操作技巧汇总

希望本文所述对大家Python程序设计有所帮助。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表