Python built-in functions are the ready-made tools such as print(), len(), sorted() and round() that come with the interpreter. You call them anywhere without an import, because Python loads them from the builtins module at startup:
prices = [19.99, 5.49, 120.00]
print(len(prices), max(prices), round(sum(prices), 2)) # 3 120.0 145.48
Before writing a word, I ran each snippet on Windows 11 under Python 3.12.5 (and checked the counts on Python 3.14.8), then pasted the Command Prompt output exactly as it appeared.
In this tutorial, we’ll see what a built-in is, how to list all of them, the main groups with short examples, a reference table and the mistakes that trip people up.
What are built-in functions in Python?
A built-in function is one Python defines for you, so it’s there the moment your script starts. You don’t import anything; the name is looked up in the builtins module after your own variables:
import builtins
print(len("Chicago"), builtins.len("Chicago"))
print(len is builtins.len)
print(type(len))
print(type(int))
Output:
7 7
True
<class 'builtin_function_or_method'>
<class 'type'>
Notice that int is a class, not a plain function. The same is true for str, list, dict and range; calling them builds a new object. Anything else you write with def is a user-defined function.
How do you list all built-in functions in Python?
Call dir() on the builtins module. It returns every name, including the exception classes, so filter for lowercase names that don’t start with an underscore:
import builtins
import textwrap
names = dir(builtins)
functions = [n for n in names if n.islower() and not n.startswith("_")]
errors = [n for n in names if n.endswith(("Error", "Exception", "Warning"))]
print("Names in builtins: ", len(names))
print("Lowercase public names:", len(functions))
print("Exceptions/warnings: ", len(errors))
print("Added by site:", [n for n in ("help", "exit", "quit", "copyright", "credits", "license") if n in functions])
print()
print(textwrap.fill(", ".join(functions), 92))
Output:
Names in builtins: 158
Lowercase public names: 75
Exceptions/warnings: 63
Added by site: ['help', 'exit', 'quit', 'copyright', 'credits', 'license']
abs, aiter, all, anext, any, ascii, bin, bool, breakpoint, bytearray, bytes, callable, chr,
classmethod, compile, complex, copyright, credits, delattr, dict, dir, divmod, enumerate,
eval, exec, exit, filter, float, format, frozenset, getattr, globals, hasattr, hash, help,
hex, id, input, int, isinstance, issubclass, iter, len, license, list, locals, map, max,
memoryview, min, next, object, oct, open, ord, pow, print, property, quit, range, repr,
reversed, round, set, setattr, slice, sorted, staticmethod, str, sum, super, tuple, type,
vars, zip

dir(builtins) returns 158 names, and the lowercase filter leaves 75 public names, printed as one wrapped list.On Python 3.12.5 that’s 158 names in total and 75 lowercase ones. Python 3.14.8 reports 160 names but the same 75. Six of them (help, exit, quit, copyright, credits, license) come from the site module.
When I started Python 3.14.8 with -S (no site), the count dropped to 69. The official 3.14 table lists 71 functions, because it also counts help() and __import__(). You’ll find more on the dir() function and dir() vs vars().
Math built-in functions: abs(), round(), sum(), min(), max(), pow()
These cover most everyday number work without importing math. Here they run on a small list of order prices in USD:
prices = [19.99, 5.49, 120.00, 64.50, 3.75]
refund = -42.10
print("abs: ", abs(refund))
print("sum: ", sum(prices), "| 0.1 + 0.2 =", sum([0.1, 0.2]))
print("min/max: ", min(prices), max(prices))
print("round: ", round(64.4999, 2), round(2.675, 2))
print("halves: ", round(0.5), round(1.5), round(2.5))
print("pow: ", round(pow(1.05, 3), 4), pow(2, 10, 1000))
print("divmod: ", divmod(125, 12))
print(f"sales tax: ${sum(prices) * 0.0825:.2f}")
Output:
abs: 42.1
sum: 213.73 | 0.1 + 0.2 = 0.30000000000000004
min/max: 3.75 120.0
round: 64.5 2.67
halves: 0 2 2
pow: 1.1576 24
divmod: (10, 5)
sales tax: $17.63

sum() shows float noise, and the halves line shows round-half-to-even.Two results surprise people. round(2.675, 2) gives 2.67 because 2.675 can’t be stored exactly as a float, and round(2.5) is 2 because Python rounds halves to the even number. See the round() function in Python.
abs() drops the sign, as covered in Python absolute value. divmod(125, 12) returns quotient and remainder together, so 125 months is 10 years and 5 months.
For totals, read the sum() function in Python. min() and max() also take a key, explained in finding the maximum value with max().
pow(2, 10, 1000) adds a fast modulo as the third argument; see the pow() method in Python.
Type conversion built-ins: int(), float(), str(), bool(), type()
Form fields, CSV columns and API values usually arrive as strings. These built-ins convert them and check what you’ve got:
raw = {"zip": "02134", "qty": "3", "price": "19.99", "member": ""}
qty = int(raw["qty"])
price = float(raw["price"])
print(qty * price, type(qty * price))
print(str(qty) + " items", bool(raw["member"]), bool("no"))
print(int(raw["zip"]), "<- the leading zero is gone")
print(list("USA"), tuple([1, 2]), sorted(set(["NY", "CA", "NY"])))
print(dict(state="TX", city="Austin"))
print(isinstance(price, (int, float)), type(raw) is dict)
try:
int(raw["price"])
except ValueError as err:
print("ValueError:", err)
Output:
59.97 <class 'float'>
3 items False True
2134 <- the leading zero is gone
['U', 'S', 'A'] (1, 2) ['CA', 'NY']
{'state': 'TX', 'city': 'Austin'}
True True
ValueError: invalid literal for int() with base 10: '19.99'
Converting a ZIP code with int() silently drops its leading zero, so keep ZIP codes as strings. int("19.99") raises a ValueError; convert with float() first.
Empty strings, 0, None and empty containers are falsy, which is why bool("") is False and bool("no") is True. The rules are in the bool() function in Python.
Prefer isinstance() over comparing type(), since it accepts a tuple of types and respects subclasses. Compare both in checking the type of a variable and isinstance() and issubclass() examples.
I’ve used sorted(set(...)) here because a set has no fixed order. Keyword arguments to dict() build a dictionary quickly, as shown in the dict() function in Python.
Iteration built-ins: len(), range(), enumerate(), zip(), sorted()
This group powers almost every loop you’ll write. Here they work on a list of US states and their capitals:
states = ["Texas", "Ohio", "California", "Iowa"]
capitals = ["Austin", "Columbus", "Sacramento", "Des Moines"]
print(len(states), list(range(1, 10, 3)))
for i, (state, capital) in enumerate(zip(states, capitals), start=1):
print(i, state, "->", capital)
print(sorted(states))
print(sorted(states, key=len, reverse=True))
print(list(reversed(states)))
it = iter(states)
print(next(it), next(it), next(it, "done"))
Output:
4 [1, 4, 7]
1 Texas -> Austin
2 Ohio -> Columbus
3 California -> Sacramento
4 Iowa -> Des Moines
['California', 'Iowa', 'Ohio', 'Texas']
['California', 'Texas', 'Ohio', 'Iowa']
['Iowa', 'California', 'Ohio', 'Texas']
Texas Ohio California

enumerate() and zip() number the state and capital pairs, then sorted() orders them alphabetically and by length.len() works on any sized object, explained in the len() function in Python. range(1, 10, 3) stops before 10, which for i in range() in Python walks through.
enumerate(..., start=1) gives you a counter without managing one; see enumerate() in Python. zip() stops at the shortest input, covered in the zip() function in Python.
sorted() returns a new list and accepts key and reverse; sorting a list alphabetically goes deeper. next(it, "done") returns the default instead of raising StopIteration when an iterator runs dry.
Functional built-ins: map(), filter(), any() and all()
These take a function or a condition and apply it across an iterable. I use them for quick transforms and yes/no checks on a list of order totals:
orders = [128.40, 42.75, 310.00, 0.00, 89.99]
taxed = map(lambda x: round(x * 1.0825, 2), orders)
print(type(taxed).__name__)
print(list(taxed))
print(list(taxed), "<- a map object runs only once")
print(list(filter(None, orders)))
print(list(filter(lambda x: x > 100, orders)))
print(any(x > 300 for x in orders), all(x > 0 for x in orders))
print(any([]), all([]))
Output:
map
[138.99, 46.28, 335.57, 0.0, 97.41]
[] <- a map object runs only once
[128.4, 42.75, 310.0, 89.99]
[128.4, 310.0]
True False
False True

list(taxed) comes back empty because a map object is consumed once, and filter(None, ...) drops the 0.0 total.Both map() and filter() return lazy iterators. You’ll find the details in the map() function in Python and ways to filter lists in Python.
Watch the last line: any([]) is False but all([]) is True. See the any() function and the all() function for how they short-circuit.
reduce() isn’t a built-in anymore. It moved to functools in Python 3, as explained in the reduce() function in Python.
Input and output built-ins: print(), input() and open()
print() does more than show text. Its sep, end and file arguments let it write a small CSV, and open() reads it back:
orders = [("Megan Bowen", 128.40), ("Alex Wilber", 42.75)]
with open("orders.csv", "w", encoding="utf-8") as f:
for name, total in orders:
print(name, f"{total:.2f}", sep=",", file=f)
with open("orders.csv", encoding="utf-8") as f:
print(f.read(), end="")
print("Saved", "2026-03-14", sep=" | ")
print(repr("Megan\tBowen"), format(1234.5, ",.2f"))
Output:
Megan Bowen,128.40
Alex Wilber,42.75
Saved | 2026-03-14
'Megan\tBowen' 1,234.50
repr() shows the escape characters a string really contains, and format() adds thousands separators. More print patterns are in printing a string and a variable.
Always open files inside with so they close for you; see Python with open(). input() pauses for the user and always returns a string, as the input() function guide shows.
Object and attribute built-ins: getattr(), setattr(), vars(), id()
These let you inspect and change objects by name at runtime. They’re handy when an attribute name comes from a config file or user input:
class Order:
def __init__(self, customer, total):
self.customer = customer
self.total = total
o = Order("Adele Vance", 310.00)
print(hasattr(o, "total"), getattr(o, "status", "pending"))
setattr(o, "status", "shipped")
print(vars(o))
print(callable(o), callable(print), isinstance(o, Order))
a = b = o
print(id(a) == id(b), type(print).__name__)
Output:
True pending
{'customer': 'Adele Vance', 'total': 310.0, 'status': 'shipped'}
False True True
True builtin_function_or_method
getattr() with a default avoids an AttributeError, and vars() shows an object’s attribute dictionary. There’s more in dynamic attributes with setattr() and getattr().
callable() tells you whether something can be called, which the callable() function covers. Equal id() values mean two names point to the same object.
Python built-in functions reference table
Here’s a compact reference for the built-ins not shown above. Every result came from one run of the expressions in the table:
| Function | What it does | Example | Result |
|---|---|---|---|
chr() | Character for a Unicode code point | chr(36) | '$' |
ord() | Code point of one character | ord("$") | 36 |
bin() | Integer as a binary string | bin(10) | '0b1010' |
hex() / oct() | Integer as hex or octal text | (hex(255), oct(8)) | ('0xff', '0o10') |
ascii() | repr() with non-ASCII escaped | ascii("café") | "'caf\\xe9'" |
format() | Format one value with a spec | format(0.0825, ".2%") | '8.25%' |
complex() | Build a complex number | complex(2, 3) | (2+3j) |
bytes() | Immutable bytes from text | bytes("USD", "utf-8") | b'USD' |
bytearray() | Mutable bytes | bytearray(b"ok") | bytearray(b'ok') |
slice() | Reusable slice object | "Chicago"[slice(1, 4)] | 'hic' |
compile() / eval() | Compile and evaluate source text | eval(compile("19.99 * 2", "demo", "eval")) | 39.98 |
A few built-ins don’t have a printable result. breakpoint() opens the debugger, as shown in the breakpoint() function. delattr() removes an attribute; see the delattr() function.
classmethod(), staticmethod() and property() are mostly used as decorators inside classes. Start with the classmethod() function.
Common mistakes with Python built-in functions
The mistake I see most is naming a variable list, sum or max. That hides the built-in until you delete the variable:
list = ["Texas", "Ohio"] # shadows the built-in list()
try:
list("abc")
except TypeError as err:
print("TypeError:", err)
del list # removes the shadow
print(list("abc"))
totals = [42.75, 128.40, 9.99]
print(totals.sort()) # list.sort() works in place
print(sorted(totals, reverse=True))
Output:
TypeError: 'list' object is not callable
['a', 'b', 'c']
None
[128.4, 42.75, 9.99]
Python checks your module’s names before builtins, which is the LEGB rule in Python variable scope. The other trap is expecting list.sort() to return the list; it returns None, while sorted() returns a new list.
Don’t pass untrusted text to eval() or exec(), because they run any code it contains. For plain literals, ast.literal_eval() is the safe choice.
Want to go further with functions after the built-ins? Try one of these next:
- Recursion in Python
- Call a function by its string name
- Python return statement
- Functions vs methods in Python
Several of these built-ins, such as sorted(), map() and filter(), take a function as an argument. I explain that idea, and how it leads to closures and decorators, in higher-order functions in Python.
Frequently asked questions
How many built-in functions does Python have?
The Python 3.14 documentation lists 71. In my run, dir(builtins) showed 75 lowercase names, because the site module adds helpers like exit and quit.
Do I need to import built-in functions?
No. They’re loaded automatically from the builtins module, so you can call len() or print() in any script.
Is print() a built-in function in Python 3?
Yes. In Python 2 print was a statement, but in Python 3 it’s a regular built-in function with sep, end and file arguments.
What happens if I name a variable after a built-in?
Your variable hides the built-in in that scope, so calling it raises a TypeError. Rename the variable or del it to get the built-in back.
Are built-in functions faster than my own functions?
Usually, yes. Most are written in C, so sum() or max() on a list beats an equivalent Python loop.
Where is the official list of Python built-in functions?
It’s the Built-in Functions page in the Python Standard Library documentation.

Bijay Kumar is a 13-time Microsoft MVP with more than 18 years in software development, and the founder of Python Guides and TSinfo Technologies. He started out building .NET and SharePoint solutions at HP, TCS and KPIT before moving into Python, machine learning and AI, and he also builds web apps with TypeScript and React. He writes the tutorials here himself, and every example is run before publishing so you see the real output. More about Bijay · Microsoft MVP profile · LinkedIn