Counter(hashable)
The number of elements per element can be hashed directly using statistics.
Most_common: The maximum number of n elements can be counted.
Statistical results support the combination of mathematical operations.
CompresS (iterable, callable)
Select the element to which the output corresponds to True based on the sequence .
Example:
Compile (Regular Expression)
precompiling A pattern string as a pattern object , the string is matched by that pattern.
Example:
Capitalize(String)
Returns a copy of a string with only the first letter capitalized.
Example:
Center (string)
format string, centered, supports incoming padding values.
Example:
Choice (Iterable)
the random choice method can be randomly selected.
Example:
Combinations(iterable, int)
Itertools of the Combinations method can produce all combinations of a collection and accept a parameter to specify the length.
Example:
combinations_with_replacement(iterable, int)
with the Combinations similar, but allows repeating selection of data.
Example:
chain(iterable,iterable)
Itertools The chain function can to accept one or more iterations of an object made as the input parameter. You then create an iterator that sequentially returns the elements in each of the iterated objects.
Example:
callable (object)
callable is checks whether object objects can be called. If true, object may still call failed, but if return False, the call Ojbect will never succeed.
Example:
CMP (object, Object)
compares two objects x and y, if x < y, returns a negative number;x = = y, returns 0 ; x > Y, returns a positive number .
Example:
Python Common functions C