B. Built-In Python Functions

In this appendix, square brackets in the syntax displays are not intended literally but indicate optional items.

The argument type iterable appears many times in this appendix. An iterable may be a collection, such as a string, list, or tuple, or any object whose class implements an _ _iter_ _ method. Generators and ranges are also iterables.

Some of the functions (such as min and max) require a sequence or group of arguments to be sortable. To be sortable, a less-than operator (<) must be successfully applied to every combination of objects in the sequence.

Table B.1. Most Commonly Used Built-In Functions

To do the following task:

Call these function(s):

Convert between ASCII and character format

ch, ord ...

Get Supercharged Python: Take Your Code to the Next Level, First Edition 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.