Table of contents
Which built-ins should you know about?
I estimate most Python developers will only ever need about 30 built-in functions, but which 30 depends on what you're actually doing with Python.
We're going to take a look at all 71 of Python's built-in functions, in a birds eye view sort of way.
I'll attempt to categorize these built-ins into five categories:
- Commonly known built-ins: most newer Pythonistas get exposure to these built-ins pretty quickly out of necessity
- Overlooked by new Pythonistas: these functions are useful to know about, but they're easy to overlook when you're newer to Python
- Learn these later: these built-ins are generally useful to know about, but you'll find them when/if you need them
- Maybe learn these eventually: these can come in handy, but only in specific circumstances
- You likely don't need these: you're unlikely to need these unless you're doing something fairly specialized
The built-in functions in categories 1 and 2 are the essential built-ins that nearly all Python programmers should eventually learn about. The built-ins in categories 3 and 4 are the specialized built-ins, which are often very useful but your need for them will vary based on your use for Python. And category 5 are arcane built-ins, which might be very handy when you need them but which many Python programmers are likely to never need.
Note for pedantic Pythonistas: I will be referring to all of these built-ins as functions, even though 27 of them aren't actually functions.
The commonly known built-in functions (which you likely already know about):
The built-in functions which are often overlooked by newer Python programmers:
There are also 5 commonly overlooked built-ins which I recommend knowing about solely because they make debugging easier:
In addition to the 25 built-in functions above, we'll also briefly see the other 46 built-ins in the learn it latermaybe learn it eventually and you likely don't need these sections.
The 10 commonly known built-in functions
If you've been writing Python …