ID EN
Built-in Functions

format

Python 3.11

Convert a value to a “formatted” representation, as controlled by format_spec. The interpretation of format_spec will depend on the type of the value argument; however, there is a standard formatting syntax that is used by most built-in types: Format Specification Mini-Language.

Syntax

PYTHON
format(value, format_spec='')

See Also

Format Specification Mini-Language str(value) __format__() TypeError object TypeError