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

Python len函数

Python len 函数 - 返回对象的长度(项目数)参数可以是序列(例如字符串 str 、元组 tuple 、列表list )或集合(例如字典 dict 、集合 set 或冻结集合 frozenset ),语法如下: ''' 参数: s ...
猿说编程的头像-猿说编程钻石会员猿说编程4年前
09632
Python update 函数-猿说编程

Python update 函数

内置函数 ChainMap 函数对多个字典合并时,合并的结果内存地址并没有发生改变,当我们修改 ChainMap 函数返回的结果时,会发现原始字典 dict 的数据也会发生相同的变化;当我修改原始字典时,Ch...
猿说编程的头像-猿说编程钻石会员猿说编程4年前
015452
Python chr / ord 函数区别和使用-猿说编程

Python chr / ord 函数区别和使用

Python chr/ord函数区别和使用 - Python 中 内置函数 chr 和 内置函数 ord 可以配对使用;chr 函数将 ascll 码转为字符;ord 函数将字符转为 ascll 码;
猿说编程的头像-猿说编程钻石会员猿说编程4年前
014381
Python sum函数-猿说编程

Python sum函数

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

Python range 函数

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

Python abs函数

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

Python reload 函数

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

Python pow 函数

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

Python callable 函数

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

Python int函数

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