| Function | Description |
|---|---|
| abs(number) | Returns the absolute value of a number |
| apply(function[, args[, kwds]]) | Calls the given function, optionally providing arguments |
| all(iterable) | Returns True if all elements of the iterable are true, otherwise False |
| any(iterable) | Returns True if any element of the iterable is true, otherwise False |
| basestring() | Abstract superclass of str and unicode, used for type checking |
| bool(object) | Returns True or False depending on the boolean value of object |
| callable(object) | Checks whether an object is callable |
| chr(number) | Returns the character whose ASCII code is the given number |
| classmethod(func) | Creates a class method from an instance method |
| cmp(x, y) | Compares x and y β returns a positive number if x>y; returns 0 if x==y |
| complex(real[, imag]) | Returns the complex number with the given real part (and optional imaginary part) |
| delattr(object, name) | Deletes the given attribute from the given object |
| dict([mapping-or-sequence]) | Constructs a dictionary, optionally from a mapping or a list of (key, value) pairs. It can also be called with keyword arguments. |
| dir([object]) | A list of (most) names in the currently visible scope, or optionally lists (most) properties of the given object |
| divmod(a, b) | Returns (a//b, a%b) (float has special rules) |
| enumerate(iterable) | Iterates over all items in the iterable as (index, item) pairs |
| eval(string[, globals[, locals]]) | Evaluates a string containing an expression. Optionally within the given global or local scope |
| execfile(file[, globals[, locals]]) | Executes a Python file, optionally within the given global or local scope |
| file(filename[, mode[, bufsize]]) | Creates the file with the given filename, optionally using the given mode and buffer size |
| filter(function, sequence) | Returns a list of the elements of the given sequence for which the function returns true |
| float(object) | Converts a string or number to a float |
| frozenset([iterable]) | Creates an immutable set, meaning it cannot be added to another set |
| getattr(object, name[, default]) | Returns the value of the specified property on the given object, optionally with a given default |
| globals() | Returns a dictionary representing the current scope |
| hasattr(object, name) | Checks whether the given object has the specified attribute |
| help([object]) | Invokes the built-in help system, or prints the help information for the given object |
| id(number) | Returns the unique ID of the given object |
| input([prompt]) | Equivalent to eval(raw_input(prompt)) |
| int(object[, radix]) | Converts a string or number (with an optional base) to an integer |
| isinstance(object, classinfo) | Checks whether the given object is an instance of the given classinfo value; classinfo can be a class object, a type object, or a tuple of class objects and type objects |
| issubclass(class1, class2) | Checks whether class1 is a subclass of class2 (every class is a subclass of itself) |
| iter(object[, sentinel]) | Returns an iterator object, which can be the object_iter() iterator used to iterate a sequence (if object supports a getitem method), or, if a sentinel is provided, the iterator calls object on each iteration until it returns the sentinel |
| len(object) | Returns the length of the given object (the number of items) |
| list([sequence]) | Constructs a list, optionally using the same items as the provided sequence |
| locals() | Returns a dictionary representing the current local scope (do not modify this dictionary) |
| long(object[, radix]) | Converts a string (optionally using the given base radix) or number to a long integer |
| map(function, sequence, …) | Creates a list consisting of the values returned when the given function is applied to each item of the provided sequence |
| max(object1, [object2, …]) | If object1 is a non-empty sequence, returns the largest element. Otherwise returns the maximum of the provided arguments (object1, object2…) |
| min(object1, [object2, …]) | If object1 is a non-empty sequence, returns the smallest element. Otherwise returns the minimum of the provided arguments (object1, object2…) |
| object() | Returns an instance of the base Object of all new-style classes |
| oct(number) | Converts an integer to a string in octal representation |
| open(filename[, mode[, bufsize]]) | An alias for file (use open rather than file when opening files |
| ord(char) | Returns the ASCII value of the given single character (a string of length 1, or a Unicode string) |
| pow(x, y[, z]) | Returns x to the power of y, optionally modulo z |
| property([fget[, fset[, fdel[, doc]]]]) | Creates a property from a set of accessors |
| range([start, ]stop[, step]) | Uses the given start value (inclusive, default 0), end value (exclusive) and step (default 1) to return a range of numbers (as a list) |
| raw_input([prompt]) | Returns data entered by the user as a string, optionally using the given prompt |
| reduce(function, sequence[, initializer]) | Incrementally applies the given function to all items of the sequence, using the accumulated result as the first argument and the item as the second, optionally with the given initial value (initializer) |
| reload(module) | Reloads an already-loaded module and returns it |
| repr(object) | Returns a string representing the object, generally used as an argument to eval |
| reversed(sequence) | Returns a reverse iterator over the sequence |
| round(float[, n]) | Rounds the given float, keeping n digits after the decimal point (default 0) |
| set([iterable) | Returns a set of elements generated from the iterable (if given) |
| setattr(object, name, value) | Sets the specified attribute of the given object to the given value |
| sorted(iterable[, cmp][,key][, reverse]) | Returns a new sorted list from the items of the iterable. The optional arguments are the same as those of the sort list method |
| staticmethod(func) | Creates a static (class) method from an instance method |
| str(object) | Returns a well-formatted string representing the given object |
| sum(seq[, start]) | Returns the sum of a series of numbers added to the optional argument start (default 0) |
| super(type[, obj/type) | Returns the superclass of the given type (optionally instantiated) |
| tuple([sequence]) | Constructs a tuple, optionally using the same items as the provided sequence |
| type(object) | Returns the type of the given object |
| type(name, base, dict) | Returns a new type object using the given name, base classes and scope |
| unichr(number) | The Unicode version of chr |
| unicode(object[, encoding[, errors]]) | Returns the Unicode-encoded version of the given object; an encoding and an error handling mode can be given (‘strict’, ‘replace’ or ‘ignore’, with ‘strict’ being the default) |
| vars([object]) | Returns a dictionary representing the local scope, or a dictionary corresponding to the properties of the given object |
| xrange([start, ]stop[, step]) | Similar to range, but the returned object uses less memory and is only used for iteration |
| zip(sequence1, …) | Returns a list of tuples, each tuple containing one item from a given sequence. The length of the returned list is the same as the length of the shortest of the provided sequences |
For details, see: http://python.usyiyi.cn
