Padding

Format

  • Number

    In [8]: '{:02d}'.format(1)
    Out[8]: '01'
    
    In [9]: '{:02d}'.format(12)
    Out[9]: '12'
    
  • String

References

[1] PyFormat@TT4IT, PyFormat —— Using % and .format() for great good!

results matching ""

    No results matching ""