Current location - Training Enrollment Network - Books and materials - Python built-in function
Python built-in function
Python built-in functions: abs, divmod, pow, round, sum, int, float, complex, str, bytearray, etc.

1, abs: absolute value function, the header file is stdlib.h, and its function is to find the absolute value of the expression.

2.divmod: Combines the results of divisor and remainder operations and returns a tuple containing quotient and remainder.

3.pow: used in C/C++. The function is to calculate the y power of x.

4.round: a basic function, which is used to round the numerical value according to the specified number of digits.

5.sum refers to the sum of numbers, logical values and text expressions of numbers in a cell area. If the parameter value is incorrect or the text cannot be converted into numbers, it will lead to an error.

6.Int: a function that rounds a numerical value down to the nearest integer. INT is an integer function among the common functions in the database, which is often used to judge whether one number can be divisible by another.

7.float: used to convert integers and strings into floating-point numbers.

8. Complex number: It is usually used to create a complex number based on given real and imaginary coefficients.

9. str: a function of VB. Numeric variables or constants can be converted into character variables or constants.

10, bytearray: an ordered variable sequence of bytes, which is a variable byte array; Value range of each element in variable array: 0

Language features of python:

1, simple

Python is a language that represents simple ideas. Reading a good Python program is just like reading English. It enables users to focus on solving problems rather than understanding the language itself.

2, easy to learn

Python is very easy to use because its documentation is very simple. Easy to read and maintain: clear and unified style, forced indentation.

3. Faster speed

The bottom layer of Python is written in C language, and many standard libraries and third-party libraries are also written in C, which runs very fast.

4. Free and open source

Python is a kind of FLOSS (free/open source software). Users can freely distribute copies of the software, read its source code, modify it, and use some of it in the new free software. FLOSS is based on the concept that a group shares knowledge.

Reference to the above content: Baidu Encyclopedia -Python