Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 26 |
Nodes: | 6 (0 / 6) |
Uptime: | 17:17:29 |
Calls: | 484 |
Calls today: | 1 |
Files: | 1,074 |
Messages: | 98,219 |
On 2024-08-27, Gilmeh Serda via Python-list <python-list@python.org> wrote:
On 25 Aug 2024 15:46:25 GMT, Stefan Ram wrote:
f"{int(number):>20,}"
Great. Thanks. Do you have a link to where that's documented?
I did web search, found nothing.
https://docs.python.org/3/library/string.html#formatspec https://docs.python.org/3/reference/lexical_analysis.html#f-strings
For docs, I usually snag the PDFs from "python.org," especially
"reference.pdf" (the Python Language Reference) and "library.pdf"
(the Python Library Reference), then I search them for keywords.
The f-string stuff is laid out in "The Python Language Reference"[snip]
since they're part of the language itself. A quick search for
But honestly, I usually just hit up a chatbot first. I'll drop
in my code and say, "How can I make this shorter?".
f"{int(number):>20,}"