convertir 1 chiffre en python à 2 chiffres
number = 10
print(number) #Output: 10
zero_filled_number = str(number).zfill(3)
print(zero_filled_number) #Output: "010"
Vitus
number = 10
print(number) #Output: 10
zero_filled_number = str(number).zfill(3)
print(zero_filled_number) #Output: "010"
You can achieve this using formatted string
num = 1
number = f"{num:02}"
--------------
output:
"01"