I want to fill out a string with spaces. I know that the following works for zero\'s:
>>> print \"\'%06d\'\"%4 \'000004\'
But wha
As of Python 3.6 you can just do
>>> strng = 'hi' >>> f'{strng: <10}'
with literal string interpolation.
Or, if your padding size is in a variable, like this (thanks @Matt M.!):
>>> to_pad = 10 >>> f'{strng: <{to_pad}}'