# if we want to pad 22 with zeros in front, to be 5 digits in length:
str_output = '{:0>5}'.format(22)
print(str_output)
# >>> 00022
# {:0>5} meaning: ":0" means: pad with 0, ">" means move 22 to right most, "5" means the total length is 5
# another example for comparision
str_output = '{:#<4}'.format(11)
print(str_output)
# >>> 11##
# to put it in a less hard-coded format:
int_inputArg = 22
int_desiredLength = 5
str_output = '{str_0:0>{str_1}}'.format(str_0=int_inputArg, str_1=int_desiredLength)
print(str_output)
# >>> 00022