Python Beginner 21st Day Function (4)-built-in function

Source: Internet
Author: User

21day

Built-in functions:

1. ABS () absolute value function

2, Dict () Create a dictionary

3. Help () Get assistance information

4, Min () remove the smallest number from a list

5, Max () remove the maximum from a list

6, BOOL () Boolean type judgment

7, All () returns False when there is one in the data that is not true

Note: Also returns True when a recyclable data type is empty

8, any () returns True when there is one in the data set that is true. Returns false only if all data is false

9. Dir () prints all the variables that exist in the current program

10, Hex () returns a number of 16, the OCT () returns a number of 8 binary, bin () returns a number of 2 binary

Ord () returns the position of the string in the Acsii table, and Chr () returns the string that the position in the Acsii table refers to

11, Slice () to define the rules of the slice in advance, convenient to call

12, Divmod () returns the modulo that is divisible, and then returns the remainder.

Equivalent to 10/3 return integer 3, remainder 1 (10//3,10%3)

13. ID () Query the memory address of a data type in memory

14. Sorted () Sort the list in the way you want it

14, Enumerate () enumeration returns the index of the list

15. Eval (), exec () converts a string into code according to the rules of the interpreter

Note:

A, eval () can only execute a single line of code. EXEC () can execute multiple lines of code

b, EXEC () No return value, eval () has return value

16, sum () sum

Python Beginner 21st Day Function (4)-built-in function

Related Article

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.