排序
Python pow 函数
Python pow 函数 - 在 Python 中内置函数 pow 共有两个参数,x和y,并返回 xy(x的y次方) 的值; ''' 参数介绍: x — 数值表达式(整数或者浮点数); y — 数值表达式(整数或者浮点数); z — ...
Python int函数
Python int函数-主要作用就是将其他数字类型强制转换为整形!注意:如果参数是字符串str类型,那么字符串中不能包含数字以外的任何字符,例如:”10.a”,这种会报错,提示:ValueError;
Python str 函数
Python str 函数 - 作为一个内置函数,可以直接将其他数据类型强制转为字符串类型 ''' 参数: object — python数据类型对象; 返回值: 返回一个str类型的变量; ''' str(object)
Python bytearray 函数
Python bytearray 函数 - Python 除了 bytes 字节序列 之外,还有 bytearray 可变的字节序列,具体区别在哪呢?顾名思义,bytes 是不可变的,而 bytearray 是可变的 返回值 : 返回一个新的可变...
Python divmod函数
divmod 函数也是 Python 的内置函数,它是把除数和余数运算结果结合起来,返回一个包含商和余数的元组 tuple (a // b, a % b); 注意:divmod 函数只能接受整数 int 或浮点数类型 float 参数不能...
Python raw_input 函数
Python raw_input 函数 - Python 3.x 版本中并没有内置函数 raw_input,如果在 Python 3.x 版本中使用内置函数 raw_input,会提示:NameError: name ‘raw_input’ is not defined input 返回的...
Python all函数
Python all函数 - ''' 参数:iterable 迭代器,元组或者列表 返回值:如果iterable 迭代器中的所有元素全部都为真,返回 true;反之返回 false; ''' all(iterable) 提示:只要列表中的元素不含...
Python issubclass 函数
Python issubclass 函数 - 主要用于判断一个对象是否为另外一个对象的子类 ''' 参数: child_class — 类对象; father_class — 类对象; 返回值:如果child_class 是 father_class 的子类,返...