python变量和常量_Python数学模块常量和示例
python變量和常量
Python數學模塊常量 (Python math module constants)
In the math module, there are some of the defined constants that can be used for various mathematical operations, these are the mathematical constants and returns their values equivalent to their standard defined values.
在數學模塊中,有一些定義的常數可用于各種數學運算,這些是數學常數,它們返回的值等于其標準定義值。
In python programming language, there are following math module constants.
在python編程語言中 ,有以下數學模塊常量 。
數學模塊/庫的常數列表 (List of constants of math module/library )
#myInput{background-image:url(/colleges/Images/searchicon.png);background-position:10px 10px;background-repeat:no-repeat;width:100%;font-size:16px;padding:12px 20px 12px 40px;border:1px solid #ddd;margin-bottom:12px}#myTable{border-collapse:collapse;width:100%;border:1px solid #ddd;font-size:18px}#myTable td,#myTable th{text-align:left;padding:2px}#myTable tr{border-bottom:1px solid #ddd}#myTable tr.header,#myTable tr:hover{background-color:#f1f1f1}#myTable a,#myTable a:visited{color:#00f;text-decoration:none}#myTable a:hover{text-decoration:underline} #myInput{background-image:url(/colleges/Images/searchicon.png);background-position:10px 10px;background-repeat:no-repeat;width:100%;font-size:16px;padding:12px 20px 12px 40px;border:1px solid #ddd;margin-bottom:12px}#myTable{border-collapse:collapse;width:100%;border:1px solid #ddd;font-size:18px}#myTable td,#myTable th{text-align:left;padding:2px}#myTable tr{border-bottom:1px solid #ddd}#myTable tr.header,#myTable tr:hover{background-color:#f1f1f1}#myTable a,#myTable a:visited{color:#00f;text-decoration:none}#myTable a:hover{text-decoration:underline}| 1 | math.pi | It returns the value of mathematics constant PI (π), the value is 3.141592... |
| 2 | math.e | It returns the value of mathematical constant e, the value is 2.718281... |
| 3 | math.tau | It returns the value of mathematical constant TAU (τ), the value is 6.283185... |
| 4 | math.inf | It returns the floating-point positive infinity, -math.inf is used to get the floating-point negative infinity. |
| 5 | math.nan | It returns the floating-point nan (Not a Number), the value is nan. |
| 1個 | 數學 | 它返回數學常數PI( π )的值,該值為3.141592 ... |
| 2 | 數學 | 它返回數學常數e的值,該值為2.718281 ... |
| 3 | 數學頭 | 它返回數學常數TAU( τ )的值,該值為6.283185 ... |
| 4 | 數學信息 | 它返回浮點正無窮大, -math.inf用于獲取浮點負無窮大。 |
| 5 | 數學南 | 它返回浮點nan (不是數字),值為nan 。 |
Python代碼演示數學模塊常量的示例 (Python code to demonstrate example of math module constants)
In this example, we are printing the value of all constants of python math module.
在此示例中,我們將打印python math模塊的所有常量的值。
# python code to demonstrate example of # math module constants# importing math module import math # printing value of PI print("value of pi = ", math.pi)# printing value of e print("value of e = ", math.e)# printing value of tau print("value of tau = ", math.tau)# printing value of infinity print("value of +ve inf = ", math.inf) print("value of -ve inf = ", -math.inf)# printing value of nan print("value of nan = ", math.nan)Output
輸出量
value of pi = 3.141592653589793 value of e = 2.718281828459045 value of tau = 6.283185307179586 value of +ve inf = inf value of -ve inf = -inf value of nan = nan翻譯自: https://www.includehelp.com/python/math-module-constants-with-examples.aspx
python變量和常量
總結
以上是生活随笔為你收集整理的python变量和常量_Python数学模块常量和示例的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 嵌套字典|python_Python |
- 下一篇: 小程序 || 语句_C ++开关语句|