Python built-in functions
- Previous page Python Reference Overview
- Next page Python String Methods
Python has a set of built-in functions.
Function | Description |
---|---|
abs() | Return the absolute value of the number |
all() | Return True if all items in the iterable are true. |
any() | Return True if any item in the iterable is true. |
ascii() | Return the readable version of the object. Replace none-ascii characters with escape characters. |
bin() | Return the binary version of the number. |
bool() | Return the boolean value of the specified object. |
bytearray() | Return a byte array. |
bytes() | Return a byte object. |
callable() | Return True if the specified object is callable, otherwise return False. |
chr() | Return the character in the specified Unicode code. |
classmethod() | Convert methods to class methods. |
compile() | Compile the specified source into a code object. |
compile() | Return the specified source as an object, ready for execution. |
complex() | Return a complex number. |
delattr() | Delete the specified attribute (attribute or method) from the specified object. |
dict() | Return a dictionary (array). |
dir() | Return a list of attributes and methods of the specified object. |
divmod() | Return a collection (such as a tuple) and return it as an enumeration object when parameter 1 is divided by parameter 2. |
enumerate() | Evaluate and execute an expression. |
exec() | Execute the specified code (or object). |
filter() | Use a filter function to exclude items from an iterable object. |
float() | Return a floating-point number. |
format() | Format the specified value. |
frozenset() | Return a frozenset object. |
getattr() | Return the value of the specified attribute (attribute or method). |
globals() | Return the current global symbol table as a dictionary. |
hasattr() | Return True if the specified object has the specified attribute (attribute/method). |
hash() | Return the hash value of the specified object. |
help() | Execute the built-in help system. |
hex() | Convert a number to a hexadecimal value. |
id() | Return the id of an object. |
input() | Allow the user to input. |
int() | Return an integer. |
isinstance() | Return True if the specified object is an instance of the specified object. |
issubclass() | Return True if the specified class is a subclass of the specified object. |
iter() | Return an iterator object. |
len() | Return the length of an object. |
list() | Return a list. |
locals() | Return the updated local symbol table dictionary. |
map() | Return a specified iterator, with a specified function applied to each item. |
max() | Return the largest item in an iterable object. |
memoryview() | Return a memory view (memory view) object. |
min() | Return the smallest item in an iterable object. |
next() | Return the next item in an iterable object. |
object() | Return a new object. |
oct() | Convert a number to an octal number. |
open() | Open a file and return a file object. |
ord() | Convert an integer to a Unicode character. |
pow() | Return the value of x raised to the power of y. |
print() | Print to the standard output device. |
property() | Get, set, and delete properties. |
range() | Returns a number sequence starting from 0 and with an increment of 1 (by default). |
repr() | Returns the readable version of the object. |
reversed() | Returns an inverted iterator. |
round() | Rounds the logarithm. |
set() | Returns a new set object. |
setattr() | Sets the attribute (attribute/method) of the object. |
slice() | Returns a slice object. |
sorted() | Returns a sorted list. |
@staticmethod() | Converts a method to a static method. |
str() | Returns a string object. |
sum() | Sum the items of an iterator. |
super() | Returns an object representing the superclass. |
tuple() | Returns a tuple. |
type() | Returns the type of the object. |
vars() | Returns the __dict__ attribute of the object. |
zip() | Returns an iterator from two or more iterators. |
- Previous page Python Reference Overview
- Next page Python String Methods