Python Convertir número a cadena con ceros principales
str(1).zfill(2)
# 1 will be '01'
str(23).zfill(4)
# 23 will be '0023'
Marton
str(1).zfill(2)
# 1 will be '01'
str(23).zfill(4)
# 23 will be '0023'
a = [1, 10]
for num in a:
print (str(num).rjust(2, '0'))
>>> 01
>>> 10
str.zfill(width)
i = 69
s = f'{i:03}' # for Python >= 3.6, zero padding to have 3 digits
>>> format(2.0, '.6f')
'2.000000'