10. Built-in Functions and Standard Library

This chapter is a compact reference to Python built-in functions. These functions are always available without any import statement. The chapter concludes with a brief overview of some useful standard library modules.

10.1 Built-in Functions

abs(x)

Returns the absolute value of x.

all(s)

Returns True if all of the values in the iterable s evaluate as True. Returns True if s is empty.

any(s)

Returns True if any of the values in the iterable s evaluate as True. Returns False if s is empty.

ascii(x)

Creates a printable representation of the object x just like the repr(), but only uses ASCII characters in the result. Non-ASCII characters are turned into appropriate escape sequences. This can be used to ...

Get Python Distilled now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.