Python Keywords & Built-ins
All 35 reserved keywords in Python 3 plus the most-used built-in functions — in one scannable reference. Drill these by typing real Python snippets.
All 35 Python Keywords
These words are reserved by the interpreter and cannot be used as identifiers.
| Keyword | Description |
|---|---|
False | Boolean false literal |
None | Null / absence of value |
True | Boolean true literal |
and | Logical AND operator |
as | Alias in import or with statements |
assert | Assertion / debug check |
async | Declare an async function or block |
await | Suspend execution of a coroutine |
break | Exit the nearest enclosing loop |
class | Define a new class |
continue | Skip to the next loop iteration |
def | Define a function |
del | Delete a variable or object attribute |
elif | Else-if branch in conditional |
else | Fallback branch in if / for / try |
except | Catch an exception |
finally | Always-run block after try/except |
for | Iterate over a sequence |
from | Import specific names from a module |
global | Declare a global variable inside a function |
if | Conditional execution |
import | Import a module |
in | Membership test / loop iteration |
is | Identity comparison (same object) |
lambda | Anonymous one-line function |
nonlocal | Refer to an enclosing scope variable |
not | Logical NOT operator |
or | Logical OR operator |
pass | No-op placeholder statement |
raise | Raise an exception |
return | Return a value from a function |
try | Begin an exception-handling block |
while | Conditional loop |
with | Context manager (auto cleanup) |
yield | Produce a value from a generator |
Essential Built-in Functions
These ship with every Python installation — no imports needed.
| Function | Purpose |
|---|---|
print() | Output to stdout |
len() | Length of a sequence |
range() | Generate a range of integers |
type() | Return the type of an object |
int() | Convert to integer |
str() | Convert to string |
float() | Convert to float |
list() | Create or convert to list |
dict() | Create or convert to dict |
set() | Create or convert to set |
tuple() | Create or convert to tuple |
bool() | Convert to boolean |
input() | Read from stdin |
open() | Open a file |
enumerate() | Iterate with index + value |
zip() | Pair elements from multiple iterables |
map() | Apply function to each element |
filter() | Keep elements where function is True |
sorted() | Return a sorted list |
reversed() | Return a reversed iterator |
sum() | Sum an iterable |
min() | Return the smallest value |
max() | Return the largest value |
abs() | Absolute value |
round() | Round a number |
isinstance() | Check type with inheritance |
hasattr() | Check if attribute exists |
getattr() | Get attribute by name |
setattr() | Set attribute by name |
repr() | Official string representation |
Practice typing these in CodeSpeedTest →
The fastest way to internalize Python syntax is to type real Python code — not read about it. Start with Hello World and work up to complex snippets.