Subject explains it, or ask.
| >>> format_number("123456789")
| ' 123,456,789'
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.
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.
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?".
Sysop: | Tetrazocine |
---|---|
Location: | Melbourne, VIC, Australia |
Users: | 4 |
Nodes: | 8 (0 / 8) |
Uptime: | 214:51:52 |
Calls: | 73 |
Calls today: | 1 |
Files: | 21,500 |
Messages: | 73,905 |