随笔分类 -  Python内置函数详解

详解Python的内置函数,使用的是3.5版本
摘要:英文文档: 2. 所有的参数必须是数值类型。 3. 如果x,y有一个是浮点数,则结果将转换成浮点数。 4. 如果x,y都是整数,则结果也是整数,除非y是负数;如果y是负数,则结果返回的是浮点数,浮点数不能取模,所有可选参数z不能传入值。 5. 如果可选参数z传入了值,x,y必须为整数,且y不能为负数 阅读全文
posted @ 2016-11-10 09:33 十月狐狸 阅读(3287) 评论(0) 推荐(0) 编辑
摘要:英文文档: 2. 其功能和chr函数刚好相反。 阅读全文
posted @ 2016-11-10 08:55 十月狐狸 阅读(1631) 评论(0) 推荐(0) 编辑
摘要:英文文档: open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None) Open file and return a corresponding fil 阅读全文
posted @ 2016-11-09 15:08 十月狐狸 阅读(6007) 评论(0) 推荐(0) 编辑
摘要:英文文档: 2. 如果传入参数不是整数,则其必须是一个定义了__index__并返回整数函数的类的实例对象。 阅读全文
posted @ 2016-11-08 13:44 十月狐狸 阅读(2548) 评论(0) 推荐(0) 编辑
摘要:英文文档: class objectReturn a new featureless object. object is a base for all classes. It has the methods that are common to all instances of Python cla 阅读全文
posted @ 2016-11-08 11:25 十月狐狸 阅读(8589) 评论(0) 推荐(0) 编辑
摘要:英文文档: 2. 函数可以接收一个可选的default参数,传入default参数后,如果可迭代对象还有元素没有返回,则依次返回其元素值,如果所有元素已经返回,则返回default指定的默认值而不抛出StopIteration 异常。 阅读全文
posted @ 2016-11-07 10:51 十月狐狸 阅读(13632) 评论(0) 推荐(0) 编辑
摘要:英文文档: min(iterable, *[, key, default]) min(arg1, arg2, *args[, key]) Return the smallest item in an iterable or the smallest of two or more arguments. 阅读全文
posted @ 2016-11-07 10:12 十月狐狸 阅读(7359) 评论(0) 推荐(0) 编辑
摘要:英文文档: class memoryview(obj) 说明: 1. 函数功能返回内存查看对象,实际上是内存查看对象(Momory view)的构造函数。 2. 所谓内存查看对象,是指对支持缓冲区协议的数据进行包装,在不需要复制对象基础上允许Python代码访问。 3. Python内置对象中支持缓 阅读全文
posted @ 2016-11-06 23:25 十月狐狸 阅读(5555) 评论(0) 推荐(0) 编辑
摘要:英文文档: max(iterable, *[, key, default]) max(arg1, arg2, *args[, key]) Return the largest item in an iterable or the largest of two or more arguments. I 阅读全文
posted @ 2016-11-06 16:09 十月狐狸 阅读(9809) 评论(1) 推荐(1) 编辑
摘要:英文文档: 2. 当传入多个可迭代对象时,函数的参数必须提供足够多的参数,保证每个可迭代对象同一索引的值均能正确传入函数。 3. 当传入多个可迭代对象时,且它们元素长度不一致时,生成的迭代器只到最短长度。 4. map函数是一个典型的函数式编程例子。 阅读全文
posted @ 2016-11-05 17:55 十月狐狸 阅读(3511) 评论(4) 推荐(2) 编辑
摘要:英文文档: locals() Update and return a dictionary representing the current local symbol table. Free variables are returned by locals() when it is called i 阅读全文
posted @ 2016-11-04 21:28 十月狐狸 阅读(1489) 评论(0) 推荐(0) 编辑
摘要:英文文档: class list([iterable]) Rather than being a function, list is actually a mutable sequence type, as documented in Lists and Sequence Types — list, 阅读全文
posted @ 2016-11-04 20:07 十月狐狸 阅读(1472) 评论(0) 推荐(0) 编辑
摘要:英文文档: 2. 如果参数为其它类型,则其必须实现__len__方法,并返回整数,否则报错。 阅读全文
posted @ 2016-11-04 19:55 十月狐狸 阅读(2255) 评论(0) 推荐(1) 编辑
摘要:英文文档: iter(object[, sentinel]) Return an iterator object. The first argument is interpreted very differently depending on the presence of the second a 阅读全文
posted @ 2016-11-03 23:48 十月狐狸 阅读(2074) 评论(2) 推荐(0) 编辑
摘要:英文文档: 3. 任何一个类都是自己类的子类,即class和calssinfo传入相同类型时,返回True。 4. 如果classinfo类型对象,是多个类型对象组成的元组,如果class类型对象是元组的任一类型对象的子类,则返回True,否则返回False。 5. 如果classinfo类型对象, 阅读全文
posted @ 2016-11-03 23:10 十月狐狸 阅读(1366) 评论(0) 推荐(0) 编辑
摘要:英文文档: isinstance(object, classinfo) Return true if the object argument is an instance of the classinfo argument, or of a (direct, indirect or virtual) 阅读全文
posted @ 2016-11-03 22:16 十月狐狸 阅读(5570) 评论(0) 推荐(1) 编辑
摘要:英文文档: class int(x=0) class int(x, base=10) Return an integer object constructed from a number or string x, or return 0 if no arguments are given. If x 阅读全文
posted @ 2016-11-03 22:00 十月狐狸 阅读(5920) 评论(0) 推荐(2) 编辑
摘要:英文文档: input([prompt]) If the prompt argument is present, it is written to standard output without a trailing newline. The function then reads a line f 阅读全文
posted @ 2016-11-02 13:45 十月狐狸 阅读(2854) 评论(0) 推荐(0) 编辑
摘要:英文文档: 阅读全文
posted @ 2016-11-01 22:38 十月狐狸 阅读(830) 评论(0) 推荐(0) 编辑
摘要:英文文档: hex(x) Convert an integer number to a lowercase hexadecimal string prefixed with “0x”, for example If x is not a Python int object, it has to de 阅读全文
posted @ 2016-10-31 12:44 十月狐狸 阅读(2496) 评论(0) 推荐(0) 编辑