Shouldn't %06s zero-pad a string?

Beat Bolli b11 at
Thu Feb 13 19:51:34 CET 2003

Hi all!

During my latest Python writing I discovered that the expression
'%06s' % 'a' doesn't return '00000a', but '     a'.

The documentation never mentions that the zero-padding only applies to 
numbers. Bug or feature?


Beat Bolli

More information about the Python-list mailing list