12/3/23, 8:55 AM Python Built-in Functions
Tutorials Exercises Services Sign Up Log in
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
Start for Free
Python Built in Functions
❮ Previous Next ❯
Python has a set of built-in functions.
Function Description
abs() Returns the absolute value of a number
all() Returns True if all items in an iterable object are true
any() Returns True if any item in an iterable object is true
ascii() Returns a readable version of an object. Replaces none-ascii
characters with escape character
bin() Returns the binary version of a number
bool() Returns the boolean value of the specified object
bytearray() Returns an array of bytes
bytes() Returns a bytes object
callable() Returns True if the specified object is callable, otherwise False
chr() Returns a character from the specified Unicode code.
classmethod() Converts a method into a class method
compile() Returns the specified source as an object, ready to be executed
complex() Returns a complex number
delattr() Deletes the specified attribute (property or method) from the
specified object
https://www.w3schools.com/python/python_ref_functions.asp 1/8
12/3/23, 8:55 AM Python Built-in Functions
dict() Tutorials Returns a dictionary (Array)
Exercises Services Sign Up Log in
dir() Returns a list of the specified object's properties and methods
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
divmod() Returns the quotient and the remainder when argument1 is
divided by argument2
enumerate() Takes a collection (e.g. a tuple) and returns it as an enumerate
object
eval() Evaluates and executes an expression
exec() Executes the specified code (or object)
filter() Use a filter function to exclude items in an iterable object
float() Returns a floating point number
format() Formats a specified value
frozenset() Returns a frozenset object
getattr() Returns the value of the specified attribute (property or method)
globals() Returns the current global symbol table as a dictionary
hasattr() Returns True if the specified object has the specified attribute
(property/method)
hash() Returns the hash value of a specified object
help() Executes the built-in help system
hex() Converts a number into a hexadecimal value
id() Returns the id of an object
input() Allowing user input
int() Returns an integer number
isinstance() Returns True if a specified object is an instance of a specified
object
issubclass() Returns True if a specified class is a subclass of a specified object
iter() Returns an iterator object
len() Returns the length of an object
list() Returns a list
https://www.w3schools.com/python/python_ref_functions.asp 2/8
12/3/23, 8:55 AM Python Built-in Functions
locals()Tutorials Returns an updated dictionary of the
Exercises Services current local symbol table
Sign Up Log in
map() Returns the specified iterator with the specified function applied
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
to each item
max() Returns the largest item in an iterable
memoryview() Returns a memory view object
min() Returns the smallest item in an iterable
next() Returns the next item in an iterable
object() Returns a new object
oct() Converts a number into an octal
open() Opens a file and returns a file object
ord() Convert an integer representing the Unicode of the specified
character
pow() Returns the value of x to the power of y
print() Prints to the standard output device
property() Gets, sets, deletes a property
range() Returns a sequence of numbers, starting from 0 and increments
by 1 (by default)
repr() Returns a readable version of an object
reversed() Returns a reversed iterator
round() Rounds a numbers
set() Returns a new set object
setattr() Sets an attribute (property/method) of an object
slice() Returns a slice object
sorted() Returns a sorted list
staticmethod() Converts a method into a static method
str() Returns a string object
sum() Sums the items of an iterator
https://www.w3schools.com/python/python_ref_functions.asp 3/8
12/3/23, 8:55 AM Python Built-in Functions
super()Tutorials Returns an object that represents the
Exercises Services parent class Sign Up Log in
tuple() Returns a tuple
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
type() Returns the type of an object
vars() Returns the __dict__ property of an object
zip() Returns an iterator, from two or more iterators
❮ Previous Log in to track progress Next ❯
ADVERTISEMENT
Text To
Speech
API
Try it for free
today
https://www.w3schools.com/python/python_ref_functions.asp 4/8
12/3/23, 8:55 AM Python Built-in Functions
Tutorials Exercises Services Sign Up Log in
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
COLOR PICKER
ADVERTISEMENT
https://www.w3schools.com/python/python_ref_functions.asp 5/8
12/3/23, 8:55 AM Python Built-in Functions
Tutorials Exercises Services Sign Up Log in
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
Text To
Speech
API
Try it for free
today
ADVERTISEMENT
Text To Speech
iFLYTEK Open Platform
https://www.w3schools.com/python/python_ref_functions.asp 6/8
12/3/23, 8:55 AM Python Built-in Functions
Tutorials Exercises Services Sign Up Log in
HTML
CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C
SPACES UPGRADE NEWSLETTER
GET CERTIFIED REPORT ERROR
Top Tutorials
HTML Tutorial
CSS Tutorial
JavaScript Tutorial
How To Tutorial
SQL Tutorial
Python Tutorial
W3.CSS Tutorial
Bootstrap Tutorial
PHP Tutorial
Java Tutorial
C++ Tutorial
jQuery Tutorial
Top References
HTML Reference
CSS Reference
JavaScript Reference
SQL Reference
Python Reference
W3.CSS Reference
Bootstrap Reference
PHP Reference
HTML Colors
Java Reference
Angular Reference
jQuery Reference
Top Examples Get Certified
HTML Examples HTML Certificate
CSS Examples CSS Certificate
JavaScript Examples JavaScript Certificate
How To Examples Front End Certificate
SQL Examples SQL Certificate
Python Examples Python Certificate
W3.CSS Examples PHP Certificate
Bootstrap Examples jQuery Certificate
PHP Examples Java Certificate
Java Examples C++ Certificate
XML Examples C# Certificate
jQuery Examples XML Certificate
FORUM ABOUT
https://www.w3schools.com/python/python_ref_functions.asp 7/8
12/3/23, 8:55 AM Python Built-in Functions
W3Schools is optimized for learning and training. Examples might be simplified to
improve reading and learning.
Tutorials Exercises Services Sign Up
Tutorials, references, and examples are constantly reviewed to avoid errors, but we
Log in
cannot warrant full correctness
HTML
CSS of allJAVASCRIPT
content. While using
SQLW3Schools,
PYTHONyou agreeJAVA
to have read
PHPand accepted
HOW TO our W3.CSS C
terms of use, cookie and privacy policy.
Copyright 1999-2023 by Refsnes Data. All Rights Reserved. W3Schools is Powered by
W3.CSS.
https://www.w3schools.com/python/python_ref_functions.asp 8/8