print("42".zfill(5)) # 00042 print(f"{42:05d}") # 00042 print(f"{-7:+04d}") # -007
zfill and format specifiers