IT入门 > 教程 > python >
  • Python math.remainder() 方法 日期:2022-09-11 点击:9409 python

    Python mathremainder(x, y) 方法返回 x/y 的余数。 Python 版本:3.7 语法 math.remainder() 方法语法如下: math.remainder(x, y) 参数说明: x -- 必需,被除数。 y -- 可选,除数。必须是非零数字,否则会...

  • Python math.sin() 方法 日期:2022-09-11 点击:5769 python

    Python math.sin(x) 返回 x 弧度的正弦值。 要获取指定角度的正弦,必须首先使用 math.radians() 方法将其转换为弧度。 Python 版本: 1.4 语法 math.sin() 方法语法如下: math.sin(x) 参数说明: x -- 必...

  • Python math.sinh() 方法 日期:2022-09-11 点击:8986 python

    Python math.sinh(x) 返回 x 的双曲正弦值。 Python 版本:1.4 语法 math.sinh() 方法语法如下: math.sinh(x) 参数说明: x -- 必需,个正数或负数。如果 x 不是一个数字,返回 TypeError。 返回值 返回一...

  • Python math.sqrt() 方法 日期:2022-09-11 点击:939 python

    Python math.sqrt(x) 方法返回 x 的平方根。 数字必须大于等于 0。 语法 math.sqrt() 方法语法如下: math.sqrt(x) 参数说明: x -- 必需,数字。如果 x 不是一个数字,返回 TypeError。如果数字小于...

  • Python math.tan() 方法 日期:2022-09-11 点击:2716 python

    Python math.tan(x) 返回 x 弧度的正切值。 Python 版本: 1.4 语法 math.tan() 方法语法如下: math.tan(x) 参数说明: x -- 必需,数字。如果 x 不是数字,则返回 TypeError。 返回值 返回一个浮点数,表...

  • Python math.tanh() 方法 日期:2022-09-11 点击:5749 python

    Python math.tanh(x) 返回 x 的双曲正切值。 Python 版本:1.4 语法 math.tanh() 方法语法如下: math.tanh(x) 参数说明: x -- 必需,个正数或负数。如果 x 不是一个数字,返回 TypeError。 返回值 返回一...

  • Python math.trunc() 方法 日期:2022-09-11 点击:9908 python

    Python math.trunc(x) 方法返回 x 截断整数的部分,即返回整数部分,忽略小数部分。 math.trunc(x) 方法不会将数字向上/向下舍入到最接近的整数,而只是删除小数。 语法 math.trunc() 方法语法如...

  • Python random randrange() 方法 日期:2022-09-11 点击:5251 python

    Python random.randrange() 方法返回指定范围内的随机数。 语法 random.randrange() 方法语法如下: random.randrange(start, stop, step) 参数说明: start -- 可选, 一个整数,指定开始值,默认值为 0。 s...

  • Python random randint() 方法 日期:2022-09-11 点击:2437 python

    Python random.randint() 方法返回指定范围内的整数。 randint(start, stop) 等价于 randrange(start, stop+1) 。 语法 random.randint() 方法语法如下: random.randint(start, stop) 参数说明: start -- 必需, 一个整...

  • python3 print函数总结 日期:2023-04-19 点击:5142 python

    1. 输出字符串和数字 >>>print("runoob") # 输出字符串runoob >>> print(100) # 输出数字100>>> str = 'runoob'>>> print(str) # 输出变量runoob>>> L = [1,2,'a'] # 列表 >>> print(L) [1, 2, 'a'] >>> t = (1,2,'a') # 元组>>> pr...