string — Common string operations — Python 3.11.16 documentation

docs.python.org

Tin mới

Text Processing Services

re — Regular expression operations

Python Module Index

3.11.16 Documentation

The Python Standard Library

Text Sequence Type — str

formatted string literals

The str.format() method and the Formatter class share the same syntax for format strings (although in the case of Formatter, subclasses can define their own format string syntax). The syntax is related to that of formatt

Format String Syntax¶

The str.format() method and the Formatter class share the same syntax for format strings (although in the case of Formatter, subclasses can define their own format string syntax). The syntax is related to that of formatt

Format Specification Mini-Language¶

“Format specifications” are used within replacement fields contained within a format string to define how individual values are presented (see Format String Syntax and f-strings). They can also be passed directly to the