Python built-in functions

Source: Internet
Author: User

ABS returns the absolute value of the parameter

>>> ABS ( -3)3

All to iterate over whether each element of an object is true

>>> All ('nidaye') True>>> All ([1, 0]) False

Any to iterate over whether the object has a true element

>>> any ('nidaye') True>>> any ([1, 0]) True

ASCII returns a String representing the object

>>> ASCII ([1, 0])'[1, 0]'

Bin returns binary notation

>>> Bin (2)'0b10'>>> bin (4)'0b100  '

ByteArray

bytes

Whether the callable can be called (Personal Understanding, plus () no error)

>>> Callable (ABS) True>>> a = 0>>> callable (a) False

CHR passes the parameter as an index, returning the value corresponding to the index in the ASCII table

>>> chr'2' >>> chr'1  '>>> chr'X '

Compile to compile strings into byte code objects, it doesn't feel good.

>>> code = Compile ('print (666)' 'exec' )>>> code"", line 1>

Complex returns the plural form (it is estimated that many people do not use it for a lifetime)

Delattr Deleting a property of an object

Divmod returns a tuple in which the first element of the tuple is the quotient of both, and the second element is the remainder of the two.

>>> Divmod (5, 2) (2, 1)

Enumerate

Python built-in functions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.