value 001 in python code example Example 1: display python 001 print("{:03d}".format(1)) Example 2: python format 001 '{:04d}'.format(42)