f String Ajouter 0 avant Python
import random
for i in [25,300,478,2,1000]:
print(f"{i:04d}")
# output: 0025 0300 0478 0002 1000
Robotechnic
import random
for i in [25,300,478,2,1000]:
print(f"{i:04d}")
# output: 0025 0300 0478 0002 1000