Python中pow()和math.pow()函數(shù)用法示例
本文實例講述了Python中pow()和math.pow()函數(shù)用法。分享給大家供大家參考,具體如下:
1. 內(nèi)置函數(shù)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**2 9 >>> pow(3,2,4)# (3**2)%4 1
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:這里再為大家推薦幾款計算工具供大家參考使用:
在線一元函數(shù)(方程)求解計算工具:
http://tools.jb51.net/jisuanqi/equ_jisuanqi
科學計算器在線使用_高級計算器在線計算:
http://tools.jb51.net/jisuanqi/jsqkexue
在線計算器_標準計算器:
http://tools.jb51.net/jisuanqi/jsq
更多關(guān)于Python相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《Python數(shù)學運算技巧總結(jié)》、《Python數(shù)據(jù)結(jié)構(gòu)與算法教程》、《Python函數(shù)使用技巧總結(jié)》、《Python字符串操作技巧匯總》、《Python入門與進階經(jīng)典教程》及《Python文件與目錄操作技巧匯總》
希望本文所述對大家Python程序設(shè)計有所幫助。
相關(guān)文章
Tensorflow中k.gradients()和tf.stop_gradient()用法說明
這篇文章主要介紹了Tensorflow中k.gradients()和tf.stop_gradient()用法說明,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-06-06
Python中的錯誤和異常處理簡單操作示例【try-except用法】
這篇文章主要介紹了Python中的錯誤和異常處理簡單操作,結(jié)合實例形式分析了Python中try except在錯誤與異常處理中的用法,需要的朋友可以參考下2017-07-07
如何利用pandas將Excel轉(zhuǎn)為html格式
工作中經(jīng)常會遇到Excel轉(zhuǎn)為html格式這種需求,下面這篇文章主要給大家介紹了關(guān)于如何利用pandas將Excel轉(zhuǎn)為html格式的相關(guān)資料,主要利用的是pd.to_html,文中通過示例代碼介紹的非常詳細,需要的朋友可以參考下2021-08-08

