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

Laura Creighton lac at strakt.com
Fri Feb 14 01:38:06 EST 2003


In a message of Thu, 13 Feb 2003 19:51:34 +0100, Beat Bolli writes:
>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?
>
>Thanks!
>
>Beat Bolli
>
>-- 
>http://mail.python.org/mailman/listinfo/python-list

I'd vote 'documentation bug'.  So yes, please report it, so the
documentation can be changed.  Documentation bug reports with a
suggested new wording especially welcome.

Laura





More information about the Python-list mailing list