Python Built-in Functions (Detailed)
__build_class__()
No extended explanation available.
__import__()
Advanced function for importing modules dynamically.
abs()
Returns the absolute value of a number. Useful for converting negative numbers to positive.
aiter()
No extended explanation available.
all()
Returns True if all elements in the iterable are true. Stops checking at the first False.
anext()
No extended explanation available.
any()
Returns True if any element in the iterable is true. Useful in conditional checks.
ascii()
Returns a readable version of an object, escaping non-ASCII characters.
bin()
Converts an integer to a binary string (e.g., bin(5) returns '0b101').
breakpoint()
Drops you into the debugger at the call site. Useful for debugging code.
callable()
Checks if an object is callable (i.e., if you can use () with it like a function).
chr()
Converts an integer (Unicode code point) to a character. Opposite of ord().
compile()
Compiles source code into a code object. Used with exec() or eval().
delattr()
Deletes an attribute from an object.
dir()
Returns a list of attributes and methods of an object.
divmod()
Returns a tuple (quotient, remainder) of dividing two numbers.
eval()
Evaluates a string as a Python expression. Be cautious of security risks.
exec()
Executes Python code dynamically. Accepts strings or code objects.
format()
Returns a formatted string using given format specifications.
getattr()
Gets the value of a named attribute from an object.
globals()
Returns a dictionary representing the current global symbol table.
hasattr()
Checks if an object has a given attribute.
hash()
Returns the hash value of an object, used in dictionaries and sets.
hex()
Converts an integer to a hexadecimal string (e.g., hex(255) returns '0xff').
id()
Returns the unique identifier (memory address) of an object.
isinstance()
Checks if an object is an instance of a class or tuple of classes.
issubclass()
Checks if a class is a subclass of another.
iter()
Returns an iterator from an iterable. Can also create custom iterators.
len()
Returns the number of items in a container (like list, string, dict).
locals()
Returns a dictionary of the current local symbol table.
max()
Returns the largest item from an iterable or among arguments.
min()
Returns the smallest item from an iterable or among arguments.
next()
Returns the next item from an iterator. Optionally provide default.
oct()
Converts an integer to an octal string (e.g., oct(8) returns '0o10').
open()
Opens a file and returns a file object. Use 'r', 'w', or 'a' modes.
ord()
Returns an integer representing the Unicode code of a character.
pow()
Returns x raised to the power y, optionally modulo z.
print()
Prints objects to the console. Supports multiple arguments and end/sep options.
repr()
Returns a string containing a printable representation of an object.
round()
Rounds a number to a specified number of digits.
setattr()
Sets the value of an attribute on an object.
sorted()
Returns a new sorted list from an iterable.
sum()
Returns the sum of all items in an iterable.
vars()
Returns the __dict__ attribute of an object.
Total Built-in Functions: 44