Python常用函数共46篇
Python sum函数-猿说编程

Python sum函数

Python sum函数-sum 函数作为 Python 内置函数,顾名思义,可以对迭代器中的所有元素求总和; iterable — 可迭代对象,如:列表、元组、集合; start — 指定相加的参数,如果没有设置这个值,...
猿说编程的头像-猿说编程钻石会员猿说编程3年前
08712
Python range 函数-猿说编程

Python range 函数

Python range 函数 - Python range 函数可创建一个整数列表,一般用在 for 循环中,语法如下: ''' 参数说明: start: 计数从 start 开始,默认是从0开始,例如:range(5)等价于range(0, 5...
猿说编程的头像-猿说编程钻石会员猿说编程3年前
09641
Python abs函数-猿说编程

Python abs函数

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

Python reload 函数

Python reload 函数 - 在 Python2.x 中 reload 函数是 Python 的内置函数; 在 Python3.x 中 reload 函数需要导入 imp 第三方库才能使用;
猿说编程的头像-猿说编程钻石会员猿说编程3年前
011791
Python pow 函数-猿说编程

Python pow 函数

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

Python callable 函数

Python callable 函数 - Python内置函数 callable 用于检查一个对象是否是可调用的,如果函数返回True,object 仍然可能调用失败;但如果返回 False,调用对象 object 绝对不会成功。 ''' 参数...
猿说编程的头像-猿说编程钻石会员猿说编程3年前
012091
Python int函数-猿说编程

Python int函数

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

Python max 函数

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

Python str 函数

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

Python bytes 函数

Python bytes 函数 - Python bytes对于刚接触 Python 的小伙伴来讲,可能还是有点陌生!bytes 是字节序列,值得注意的是它有取值范围:0
猿说编程的头像-猿说编程钻石会员猿说编程3年前
014143