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"