⬅︎ Back to How to pad/fill a string by a variable in Python using f-strings
Hi,> I.e. does anybody know how to do this, but with f-strings:The answer is simple:>>> mystr = 'peter'>>> f'{mystr:*<10}''peter*****'
Comment
Hi,
> I.e. does anybody know how to do this, but with f-strings:
The answer is simple:
>>> mystr = 'peter'
>>> f'{mystr:*<10}'
'peter*****'