Some built-in functions and commonly used functions:
Built-in functions:
- ABS: Returns the absolute value of a number.
- Chr (number): ASCII converted to character, opposite function order
- Divmod (NUM1, num2): The quotient and remainder are obtained, and a tuple is returned. Divmod (10,3) = (3,1)
- Eval (source[, globals[, locals]): To find the value of an expression
- Excefile (object[, globals[, locals]):The EXEC statement is used to execute a python statement stored in a string or file.
- Example: Exec (' Print ("' abc ') ') output ' abc '
- Filter (function or None, list): Each item of list is filtered by function. function, if a value is required to continue to exist, the return value is true and vice versa with false.
- Len (object): Find the number of children of an object
- Map (function, iterable_objects): Receives a function and an iterative object (such as a list) as a parameter, processes each element with a function, and then returns a new list.
- Max (): Find the maximum
- Min (): To find the smallest item
- Ord (character): character converted to ASCII, opposite function Chr
- Pow (x, y[, z]): exponentiation (z is optional for modulo)
- Range (): Produce a list
- Repr (object): Converts an object to a string, and many times the object can be restored by eval (repr (object))
- SUM (list): Sums of all values of the sequence are evaluated
- Type (object): View data Object type
- Range ([Start,] stop[, step]), Range object: left open right closed.
- Round (number[, ndigits]), number: Convert floating-point numbers to specified decimal digits
- Hex (number): A string converted to 16 binary
- Oct (number): string converted to octal
- int (str): Character converted to numeric function
- Float (object): Converts an object to a floating-point number.
- Str (object): Converts an object to a string
Other functions:
- Decimal: Controls the exact number of decimal places: (Need to be introduced first: from decimal import decimal)
Python3 Learning DAY4