How can I set 40 as a let say variable temp which are computed on the fly and passed instead 40 in this format string:
40
temp
{:<40}.format('aa')
Something like this should work:
>>> width = 40 >>> '{0:<{width}}'.format('aa', width=width) 'aa '