add 0s to start of string python code example Example: python add zero to string # add zeros in front of a string >>> n = '4' >>> print(n.zfill(3)) 004