How to create this kind of strings with python:
" 2558. "
" 2. "
" 1224456. "
I have integer
, 11 spaces and .
.
First is leading space, then integer, after integer is dot, and after dot are spaces untill it reaches 11 places
I can go:
x = "{: d}{}".format(25, '.')
y = "|{:11s}|".format(x)
print:
| 25. |
Is it possible to do that in one line and one string?