5.7. Related Modules

There are a number of modules in the Python standard library that add-on to the functionality of the operators and built-in functions for numeric types. Table 5.7 lists the key modules for use with numeric types. Refer to the literature or online documentation for more information on these modules.

Table 5.7. Numeric Type Related Modules
module contents
array implements array types… a restricted sequence type
math/cmath supplies standard C library mathematical functions; most functions available in math are implemented for complex numbers in the cmath module
operator contains numeric operators available as function calls, i.e., operator.sub(m, n) is equivalent to the difference (m - n) for numbers m and n
random ...

Get Core Python Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.