ABS () |
Returns the absolute value of a number |
|
Min () |
Returns the minimum value of a given parameter, which can be a sequence |
|
Max () |
Returns the maximum value of the given parameter, which can be a sequence |
|
Help () |
function to view a detailed description of the purpose of a function or module |
Help (' str ') # to see how the STR data type helps |
SetAttr () |
Used to set the property value, which must exist |
SetAttr (person, ' sex ', ' M ') # Set Property bar value |
GetAttr () |
Used to return an object property value |
|
Delattr () |
For deleting properties, delattr (x, ' Foobar ') equals del X.foobar |
|
Dir () |
Returns a list of the variables, methods, and definitions in the current scope, with parameters, and returns the properties of the parameter, a list of methods, when not with parameters. If the parameter contains method dir(), the method is invoked. If the parameter does not contain dir(), the method collects parameter information to the fullest extent |
|
ITER () |
Used to generate an iterator |
|
Next () |
Returns the next project for the iterator |
|
Divmod () |
function combines the result of divisor and remainder operations to return a tuple (A//b, a% B) that contains the quotient and remainder. |
Divmod (7, 2)-> (3, 1) |
ID () |
Used to get the memory address of an object |
|
Sorted () |
Sort is the method that is applied on the list for all objects that can be iterated, and sorted can sort all the objects that can be iterated |
|
Enumerate () |
Used to combine a data object that can be traversed (such as a list, tuple, or string) into an index sequence, listing data and data subscripts, typically used in a for loop |
|
Open () |
Used to open a file |
Open (' Test.txt ') |
Isinstance () |
To determine whether an object is a known type, similar to type (), Isinstance () considers a subclass to be a parent class type, considering an inheritance relationship |
|
Type () |
Determines an object type and does not consider a subclass to be a parent class type, regardless of the inheritance relationship |
|
SUM () |
To sum a series |
SUM ([0,1,2]), SUM ([0,1,2,3,4], 2) |
Filter () |
Functions are used to filter sequences, filter out elements that are not eligible, and return a new list of qualified elements, filter (function, iterable) |
def IS_SQR (x): Return math.sqrt (x)% 1 = 0; NewList = filter (IS_SQR, Range (1, 101)) |
Issubclass () |
Determines whether the parameter class is a subclass of the type parameter ClassInfo, Issubclass (class, ClassInfo) |
Issubclass (B,a), B is a subclass of |
Pow (x, y[, z]) |
The value of xy (Y-second side of X), if z is present, the result is modulo, and the result is equivalent to POW (x,y)%z,pow () is called directly from the built-in method, and the built-in method takes the argument as an integral type, and the Math module's POW () converts the argument to float |
|
Super () |
A method used to invoke the parent class (superclass) |
|
Format () |
Output Format function, the specific use of the method reference: Rookie Tutorial http://www.runoob.com/python/att-string-format.html |
|
Len () |
Returns the length or number of items (characters, lists, tuples, etc.) |
|
Range () |
The range (start, stop[, step) function returns an iterative object (type is an object), not a list type, so the list is not printed when printed |
Range (5) |
Zip () |
Takes an object that can be iterated as a parameter, packs the corresponding elements in the object into a tuple, and then returns a list of those tuples. If the number of elements in each iterator is inconsistent, the return list is the same length as the shortest object, and the * operator allows you to extract the tuple into a list. |
Packaging: zipped = Zip (a,b), decompression: Zip (*zipped) |
Map () |
Maps the specified sequence according to the provided function, map (function, iterable, ...), and the first parameter function calls the function function with each element in the parameter sequence, and returns a new list containing the return value of each of the function functions. |
|
Round () |
Returns the rounding value of a floating-point number X |
|
Hash () |
Used to get a hash of an object (a string or numeric value, etc.) |
Hash (' Test ') |
Set () |
Create a unordered set of not repeating elements that you can test for relationships, delete duplicate data, and compute intersections, sets, and sets |
|