mirror of
https://github.com/python/cpython.git
synced 2025-10-02 05:12:23 +00:00
bpo-32735: Fix typo in f-strings datetime format specifier example (GH-5464)
The f-string example for using datetime format specifier does not match the given output. Changed the format from %b to %B so it matches the output of "January".
This commit is contained in:
parent
f3da70f8ab
commit
70e304252a
1 changed files with 1 additions and 1 deletions
|
@ -676,7 +676,7 @@ Some examples of formatted string literals::
|
||||||
>>> f"result: {value:{width}.{precision}}" # nested fields
|
>>> f"result: {value:{width}.{precision}}" # nested fields
|
||||||
'result: 12.35'
|
'result: 12.35'
|
||||||
>>> today = datetime(year=2017, month=1, day=27)
|
>>> today = datetime(year=2017, month=1, day=27)
|
||||||
>>> f"{today:%b %d, %Y}" # using date format specifier
|
>>> f"{today:%B %d, %Y}" # using date format specifier
|
||||||
'January 27, 2017'
|
'January 27, 2017'
|
||||||
>>> number = 1024
|
>>> number = 1024
|
||||||
>>> f"{number:#0x}" # using integer format specifier
|
>>> f"{number:#0x}" # using integer format specifier
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue