mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
[3.12] gh-110383: Improve 'old string formatting' text in tutorial (GH-120219) (#120230)
(cherry picked from commit 225aab7f70
)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
This commit is contained in:
parent
ac68d83fec
commit
9cdf696075
1 changed files with 5 additions and 3 deletions
|
@ -279,9 +279,11 @@ left with zeros. It understands about plus and minus signs::
|
|||
Old string formatting
|
||||
---------------------
|
||||
|
||||
The % operator (modulo) can also be used for string formatting. Given ``'string'
|
||||
% values``, instances of ``%`` in ``string`` are replaced with zero or more
|
||||
elements of ``values``. This operation is commonly known as string
|
||||
The % operator (modulo) can also be used for string formatting.
|
||||
Given ``format % values`` (where *format* is a string),
|
||||
``%`` conversion specifications in *format* are replaced with
|
||||
zero or more elements of *values*.
|
||||
This operation is commonly known as string
|
||||
interpolation. For example::
|
||||
|
||||
>>> import math
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue