string.zfill() pads a numeric string on the left with zeros. : Zfill : String PYTHON examples


PYTHON examples » String » Zfill »

 

string.zfill() pads a numeric string on the left with zeros.


 

It understands about plus and minus signs:


import string
print string.zfill('12', 5)
print string.zfill('-3.14', 7)
print string.zfill('3.14159265359', 5)

   
  



    Related Scripts with Example Source Code in same category :

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo String
» Zfill