
Built-in Functions — Python 3.13.3 documentation
1 day ago · Built-in Functions¶ The Python interpreter has a number of functions and types built into it that are always available. They are listed here in alphabetical order.
Functional Programming HOWTO — Python 3.13.3 documentation
In Python you might combine the two approaches by writing functions that take and return instances representing objects in your application (e-mail messages, transactions, etc.). Functional design may seem like an odd constraint to work under.
Design and History FAQ — Python 3.13.3 documentation
2 days ago · functions = {'a': function_1, 'b': function_2, 'c': self. method_1} func = functions [value] func () For calling methods on objects, you can simplify yet further by using the getattr() built-in to retrieve methods with a particular name:
math — Mathematical functions — Python 3.13.3 documentation
1 day ago · This module provides access to the mathematical functions defined by the C standard. These functions cannot be used with complex numbers; use the functions of the same name from the cmath module if...
6. Modules — Python 3.13.3 documentation
1 day ago · You may also want to use a handy function that you’ve written in several programs without copying its definition into each program. To support this, Python has a way to put definitions in a file and use them in a script or in an interactive instance of the interpreter.
Sorting Techniques — Python 3.13.3 documentation
1 day ago · Unlike key functions that return an absolute value for sorting, a comparison function computes the relative ordering for two inputs. For example, a balance scale compares two samples giving a relative ordering: lighter, equal, or heavier.
9. Classes — Python 3.13.3 documentation
2 days ago · Compared with other programming languages, Python’s class mechanism adds classes with a minimum of new syntax and semantics. It is a mixture of the class mechanisms found in C++ and Modula-3.
operator — Standard operators as functions - Python
2 days ago · The operator module exports a set of efficient functions corresponding to the intrinsic operators of Python. For example, operator.add(x, y) is equivalent to the expression x+y . Many function names are those used for special methods, without the double underscores.
5. Data Structures — Python 3.13.3 documentation
1 day ago · In the real world, you should prefer built-in functions to complex flow statements. The zip() function would do a great job for this use case: >>> list ( zip ( * matrix )) [(1, 5, 9), (2, 6, 10), (3, 7, 11), (4, 8, 12)]
dis — Disassembler for Python bytecode — Python 3.13.3 …
4 days ago · Analyse the bytecode corresponding to a function, generator, asynchronous generator, coroutine, method, string of source code, or a code object (as returned by compile()). This is a convenience wrapper around many of the functions listed below, most notably get_instructions() , as iterating over a Bytecode instance yields the bytecode ...