On 2024-08-31 06:31, Gilmeh Serda via Python-list wrote:
On Fri, 30 Aug 2024 05:22:17 GMT, Gilmeh Serda wrote:
f"{int(number):>20,}"
I can find "," (comma) and I can find "_" (underscore) but how about " "
(space)?
Or any other character, for that matter?
Any ideas?
Of course I can do f"{123456:>20_}".replace("_", " "), just thought there
might be something else my search mojo fails on.
The format is described here:
https://docs.python.org/3/library/string.html#formatspec
A space is counted as a fill character.
--
https://mail.python.org/mailman/listinfo/python-list