0
推荐
1577
阅读

Python3.6内置函数(18)——enumerate()

英文文档enumerate(iterable, start=0)Return an enumerate object. iterable must be a sequence, an iterator, or some other object which supports iteration. The __next__() method of the iterator returned by enumerate() returns a tuple containing a count (from start which defaults to 0) and the values...

发表了文章 • 2019-06-30 23:45 • 0 条评论

0
推荐
1514
阅读

Python3.6内置函数(17)——divmod()

英文文档Take two (non complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using integer division. With mixed operand types, the rules for binary arithmetic operators apply. For integers, the result is the same as (a // b, a % b). For floating...

发表了文章 • 2019-06-30 23:44 • 0 条评论

0
推荐
1438
阅读

Python3.6内置函数(16)——dir()

英文文档dir([object])Without arguments, return the list of names in the current local scope. With an argument, attempt to return a list of valid attributes for that object.If the object has a method named __dir__(), this method will be called and must return the list of attributes. This allows ob...

发表了文章 • 2019-06-30 23:43 • 0 条评论

0
推荐
1629
阅读

Python3.6内置函数(15)——dict()

英文文档class dict(**kwarg)class dict(mapping, **kwarg)class dict(iterable, **kwarg)Create a new dictionary. The dict object is the dictionary class. See dict and Mapping Types — dict for documentation about this class.For other containers see the built-in list, set, and tuple classes, as well as...

发表了文章 • 2019-06-29 15:42 • 0 条评论

0
推荐
1678
阅读

Python3.6内置函数(14)——delattr()

英文文档delattr(object, name)This is a relative of setattr(). The arguments are an object and a string. The string must be the name of one of the object’s attributes. The function deletes the named attribute, provided the object allows it. For example, delattr(x, ‘foobar’) is equivalent to del x....

发表了文章 • 2019-06-29 15:34 • 0 条评论

0
推荐
1473
阅读

Python3.6内置函数(13)——complex()

英文文档Return a complex number with the value real + imag*1j or convert a string or number to a complex number. If the first parameter is a string, it will be interpreted as a complex number and the function must be called without a second parameter. The second parameter can never be a string. E...

发表了文章 • 2019-06-29 15:32 • 0 条评论

0
推荐
1417
阅读

Python3.6内置函数(12)——compile()

英文文档compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1)Compile the source into a code or AST object. Code objects can be executed by exec() or eval(). source can either be a normal string, a byte string, or an AST object. Refer to the ast module documentation for informa...

发表了文章 • 2019-06-29 15:11 • 0 条评论

0
推荐
1577
阅读

Python3.6内置函数(11)——classmethod()

英文文档classmethod(function)Return a class method for function.A class method receives the class as implicit first argument, just like an instance method receives the instance. To declare a class method, use this idiom:class C:     @classmethod     def f(cls, arg1...

发表了文章 • 2017-06-14 10:27 • 0 条评论

0
推荐
1579
阅读

Python3.6内置函数(10)——chr()

英文文档chr(i)Return the string representing a characterwhose Unicode code point is the integer i. For example, chr(97) returns thestring ‘a’, while chr(8364) returns the string ‘€’. This is the inverse oford().The valid range for the argument is from 0through 1,114,111 (0x10FFFF in base 16). Val...

发表了文章 • 2017-06-13 15:27 • 0 条评论

0
推荐
1469
阅读

Python3.6内置函数(9)——callable()

英文文档callable(object)Return True if the object argument appearscallable, False if not. If this returns true, it is still possible that a callfails, but if it is false, calling object will never succeed. Note that classesare callable (calling a class returns a new instance); instances are calla...

发表了文章 • 2017-06-12 15:31 • 0 条评论

0
推荐
1814
阅读

Python3.6内置函数(8)——bytes()

英文文档class bytes([source[, encoding[, errors]]])Return a new “bytes” object, which is animmutable sequence of integers in the range 0 <= x < 256. bytes is animmutable version of bytearray – it has the same non-mutating methods and thesame indexing and slicing behavior.According...

发表了文章 • 2017-06-12 11:46 • 0 条评论

0
推荐
2472
阅读

Python3.6内置函数(7)——bytearray()

英文文档class bytearray([source[, encoding[, errors]]])Return a new array of bytes. The bytearray class is a mutable sequence of integers in the range 0 <= x < 256. It has most of the usual methods of mutable sequences, described in Mutable Sequence Types, as well as most methods that ...

发表了文章 • 2017-06-12 11:45 • 0 条评论

0
推荐
1689
阅读

Python3.6内置函数(5)——bin()

英文文档bin(x)Convert an integer number to a binary string. The result is a valid Python expression. If x is not a Python int object, it has to define an __index__() method that returns an integer.bin()1、将一个整型数字转换成二进制字符串>>> a = bin(1) >>> a '0b1' >>> ty...

发表了文章 • 2017-06-07 09:09 • 0 条评论

0
推荐
1517
阅读

Python3.6内置函数(4)——ascii()

英文文档ascii(object)As repr(), return a string containing a printable representation of an object, but escape the non-ASCII characters in the string returned by repr() using \x, \u or \U escapes. This generates a string similar to that returned by repr() in Python 2.ascii()1、返回一个可打印的对...

发表了文章 • 2017-06-06 14:16 • 0 条评论

0
推荐
1327
阅读

Python3.6内置函数(3)——any()

英文文档any(iterable)Return True if any element of the iterable is true. If the iterable is empty, return False Equivalent to:如果iterable的一个元素不为0、”、False或者iterable为空,any(iterable)返回True,否则返回False。函数等价于:def any(iterable):    for element in itera...

发表了文章 • 2017-06-06 14:15 • 0 条评论