pad int python with zeros code example Example 1: how to append leading zeros in python str.zfill(width) Example 2: fill zero behind number python f_num.strip().zfill(2)