IT入门 > 教程 > python >
  • Python3 cos() 函数 日期:2022-09-11 点击:7314 python

    描述 cos() 返回x的弧度的余弦值。 语法 以下是 cos() 方法的语法: import mathmath.cos(x) 注意: cos()是不能直接访问的,需要导入 math 模块,然后通过 math 静态对象调用该方法。 参数 x -- 一个...

  • Python3 hypot() 函数 日期:2022-09-11 点击:5649 python

    描述 hypot() 返回欧几里德范数 sqrt(x*x + y*y)。 语法 以下是 hypot() 方法的语法: import mathmath.hypot(x, y) 注意: hypot()是不能直接访问的,需要导入 math 模块,然后通过 math 静态对象调用该方...

  • Python3 sin() 函数 日期:2022-09-11 点击:2468 python

    描述 sin() 返回的x弧度的正弦值。 语法 以下是 sin() 方法的语法: import mathmath.sin(x) 注意: sin()是不能直接访问的,需要导入 math 模块,然后通过 math 静态对象调用该方法。 参数 x -- 一个...

  • Python3 tan() 函数 日期:2022-09-11 点击:6712 python

    描述 tan() 返回 x 弧度的正切值。 语法 以下是 tan() 方法的语法: import mathmath.tan(x) 注意: tan()是不能直接访问的,需要导入 math 模块,然后通过 math 静态对象调用该方法。 参数 x -- 一个...

  • Python3 degrees() 函数 日期:2022-09-11 点击:2874 python

    描述 degrees() 将弧度转换为角度。 语法 以下是 degrees() 方法的语法: import mathmath.degrees(x) 注意: degrees()是不能直接访问的,需要导入 math 模块,然后通过 math 静态对象调用该方法。 参数...

  • Python3 radians() 函数 日期:2022-09-11 点击:3205 python

    描述 radians() 方法将角度转换为弧度。 角度和弧度关系是:2π 弧度 = 360°。从而 1°≈0.0174533 弧度,1 弧度≈57.29578°。 1) 角度转换为弧度公式:弧度=角度÷180×π 2)弧度转换为角度公式:...

  • Python3 capitalize()方法 日期:2022-09-11 点击:6644 python

    描述 Python capitalize() 将字符串的第一个字母变成大写,其他字母变小写。 语法 capitalize() 方法语法: str.capitalize() 参数 无。 返回值 该方法返回一个首字母大写的字符串。 实例 以下实...

  • Python3 center()方法 日期:2022-09-11 点击:1437 python

    center() 方法返回一个指定的宽度 width 居中的字符串,fillchar 为填充的字符,默认为空格。 语法 center()方法语法: str.center(width[, fillchar]) 参数 width -- 字符串的总宽度。 fillchar -- 填充字...

  • Python3 count()方法 日期:2022-09-11 点击:10600 python

    描述 count() 方法用于统计字符串里某个字符出现的次数。可选参数为在字符串搜索的开始与结束位置。 语法 count()方法语法: str.count(sub, start= 0,end=len(string)) 参数 sub -- 搜索的子字符串...

  • Python3 bytes.decode()方法 日期:2022-09-11 点击:9925 python

    描述 decode() 方法以指定的编码格式解码 bytes 对象。默认编码为 'utf-8'。 语法 decode()方法语法: bytes.decode(encoding="utf-8", errors="strict") 参数 encoding -- 要使用的编码,如"UTF-8"。 errors -- 设置...