Dynamic Zero Padding.

Chris Angelico rosuav at gmail.com
Tue Jun 7 19:26:40 EDT 2011


On Wed, Jun 8, 2011 at 7:43 AM, Mel <mwilson at the-wire.com> wrote:
> :)
>
> ('%%0%dd' % (pads,)) % (n,)
>
> Probably be good to wrap it in a function.  It looks kind of obscure as it
> is.

Would get rather pretty (read: ugly and impossible to read) if you
wanted to put a literal percent sign in front of the number.

:)

Chris Angelico



More information about the Python-list mailing list