fork download
  1. iNum = 123 #will always be a number
  2. sPaddingChar = "0"
  3. iNumPads = 6
  4.  
  5. #print the number with padded zeros, using % rather than .format
  6. print('%s' % (str(iNum).rjust(iNumPads, sPaddingChar)))
  7. print(type(iNum))
  8.  
Success #stdin #stdout 0.02s 27704KB
stdin
Standard input is empty
stdout
000123
<class 'int'>