Python常用函数 第3页
Python abs函数-猿说编程

Python abs函数

Python abs函数-abs 函数是 Python 内置函数,主要作用就是计算数字的绝对值!
猿说编程的头像-猿说编程钻石会员猿说编程4年前
012052
Python max 函数-猿说编程

Python max 函数

python max函数 - max 函数返回给定参数的最大值,参数可以为序列语法: # 返回值:返回参数中的最大值; max( x, y, z, .... )
猿说编程的头像-猿说编程钻石会员猿说编程4年前
012322
Python pow 函数-猿说编程

Python pow 函数

Python pow 函数 - 在 Python 中内置函数 pow 共有两个参数,x和y,并返回 xy(x的y次方) 的值; ''' 参数介绍: x — 数值表达式(整数或者浮点数); y — 数值表达式(整数或者浮点数); z — ...
猿说编程的头像-猿说编程钻石会员猿说编程4年前
016372
Python int函数-猿说编程

Python int函数

Python int函数-主要作用就是将其他数字类型强制转换为整形!注意:如果参数是字符串str类型,那么字符串中不能包含数字以外的任何字符,例如:”10.a”,这种会报错,提示:ValueError;
猿说编程的头像-猿说编程钻石会员猿说编程4年前
015102
Python str 函数-猿说编程

Python str 函数

Python str 函数 - 作为一个内置函数,可以直接将其他数据类型强制转为字符串类型 ''' 参数: object — python数据类型对象; 返回值: 返回一个str类型的变量; ''' str(object)
猿说编程的头像-猿说编程钻石会员猿说编程4年前
09892
Python bytearray 函数-猿说编程

Python bytearray 函数

Python bytearray 函数 - Python 除了 bytes 字节序列 之外,还有 bytearray 可变的字节序列,具体区别在哪呢?顾名思义,bytes 是不可变的,而 bytearray 是可变的 返回值 : 返回一个新的可变...
猿说编程的头像-猿说编程钻石会员猿说编程4年前
09702
Python divmod函数-猿说编程

Python divmod函数

divmod 函数也是 Python 的内置函数,它是把除数和余数运算结果结合起来,返回一个包含商和余数的元组 tuple (a // b, a % b); 注意:divmod 函数只能接受整数 int 或浮点数类型 float 参数不能...
猿说编程的头像-猿说编程钻石会员猿说编程4年前
015422
Python raw_input 函数-猿说编程

Python raw_input 函数

Python raw_input 函数 - Python 3.x 版本中并没有内置函数 raw_input,如果在 Python 3.x 版本中使用内置函数 raw_input,会提示:NameError: name ‘raw_input’ is not defined input 返回的...
猿说编程的头像-猿说编程钻石会员猿说编程4年前
010012
Python all函数-猿说编程

Python all函数

Python all函数 - ''' 参数:iterable 迭代器,元组或者列表 返回值:如果iterable 迭代器中的所有元素全部都为真,返回 true;反之返回 false; ''' all(iterable) 提示:只要列表中的元素不含...
猿说编程的头像-猿说编程钻石会员猿说编程4年前
010912
Python issubclass 函数-猿说编程

Python issubclass 函数

Python issubclass 函数 - 主要用于判断一个对象是否为另外一个对象的子类 ''' 参数: child_class — 类对象; father_class — 类对象; 返回值:如果child_class 是 father_class 的子类,返...
猿说编程的头像-猿说编程钻石会员猿说编程4年前
010102