Fixed width number formatting python 3
Prefix the width with a 0
:
>>> '{0:03}'.format(1)
'001'
Also, you don't need the place-marker in recent versions of Python (not sure which, but at least 2.7 and 3.1):
>>> '{:03}'.format(1)
'001'
Better:
number=12
print(f'number is equal to {number:03d}')