# add zeros in front of a string >>> n = '4' >>> print(n.zfill(3)) 004
my_str='0001' my_str.lstrip('0')